This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Example extends Activity | |
| implements OnClickListener { | |
| protected void onCreate(Bundle savedValues) { | |
| // 구현부분 | |
| Button button = (Button)findViewById(R.id.btn); | |
| button.setOnClickListener(this); | |
| } | |
| public void onClick(View v) { | |
| // 구현부분 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout | |
| android:orientation="vertical" | |
| ... > | |
| <Button android:id="@+id/top" | |
| android:nextFocusUp="@+id/bottom" | |
| ... /> | |
| <Button android:id="@+id/bottom" | |
| android:nextFocusDown="@+id/top" | |
| ... /> | |
| </LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout | |
| android:orientation="vertical" | |
| <!-- 구현부분 --> > | |
| <Button android:id="@+id/top" | |
| android:nextFocusUp="@+id/bottom" | |
| <!-- 구현부분 --> /> | |
| <Button android:id="@+id/bottom" | |
| android:nextFocusDown="@+id/top" | |
| <!-- 구현부분 --> /> | |
| </LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Context context = getApplicationContext(); CharSequence text = “Hello toast!”; int duration = Toast.LENGTH_SHORT; | |
| Toast toast = Toast.makeText(context, text, duration); toast.show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Context context = getApplicationContext(); | |
| CharSequence text = "토스트 메시지 입니다."; | |
| int duration = Toast.LENGTH_SHORT; | |
| Toast toast = Toast.makeText(context, text, duration); | |
| toast.show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Toast.makeText(context, text, duration).show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Context context = getApplicationContext(); | |
| CharSequence text = "토스트로 통보하기 입니다."; | |
| int duration = Toast.LENGTH_LONG; | |
| Toast toast = Toast.makeText(context, text, duration); | |
| toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0); | |
| toast.show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@+id/toast_layout_root" | |
| android:orientation="horizontal" | |
| android:layout_width="fill_parent" | |
| android:layout_height="fill_parent" | |
| android:padding="10dp" | |
| android:background="#DAAA" | |
| > | |
| <ImageView android:id="@+id/image" | |
| android:layout_width="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LayoutInflater inflater = getLayoutInflater(); | |
| View layout = inflater.inflate(R.layout.toast_layout, | |
| (ViewGroup) findViewById(R.id.toast_layout_root)); | |
| ImageView image = (ImageView) layout.findViewById(R.id.image); | |
| image.setImageResource(R.drawable.icon); | |
| TextView text = (TextView) layout.findViewById(R.id.text); | |
| text.setText("커스텀 토스트 완성!!!"); | |
| Toast toast = new Toast(getApplicationContext()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String ns = Context.NOTIFICATION_SERVICE; | |
| NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); |