in the same way i try to call another showToast method.but its not displaying its content...
Using java Syntax Highlighting
- public class MatchingProfile extends Activity {
- int count1=0;
- //NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.incomingmessage);
- Button button = (Button) findViewById(R.id.notify);
- button.setOnClickListener(new Button.OnClickListener() {
- public void onClick(View v)
- {
- showToast();
- showToast1(); //2nd time calling
- }
- });
- }
- protected void showToast()
- {
- // create the view
- View view = inflateView(R.layout.incoming_message_panel);
- // set the text in the view
- TextView tv = (TextView)view.findViewById(R.id.message);
- tv.setText("\n25,Male,5,55,Madipakkam\n"+
- "\n24,Male,6,65,Madipakkam\n"+
- "\n26,Male,5.5,58,Madipakkam\n"+
- "\n27,Male,4.5,75,Madipakkam\n"+
- "\n28,Male,5,66,Madipakkam\n"+
- "\n29,Male,4,78,Madipakkam\n");
- // show the toast
- Toast toast = new Toast(this);
- toast.setView(view);
- toast.setDuration(Toast.LENGTH_LONG);
- toast.show();
- }
- private View inflateView(int resource) {
- ViewInflate vi = (ViewInflate)getSystemService(Context.INFLATE_SERVICE);
- return vi.inflate(resource, null, null);
- }
- protected void showToast1()
- {
- // create the view
- View view = inflateView(R.layout.incoming_message_panel);
- // set the text in the view
- TextView tv = (TextView)view.findViewById(R.id.message);
- tv.setText("\n25,Male,5,55,Madipakkam\n"+
- "\n24,Male,6,65,Madipakkam\n"+
- "\n26,Male,5.5,58,Madipakkam\n"+
- "\n27,Male,4.5,75,Madipakkam\n"+
- "\n28,Male,5,66,Madipakkam\n"+
- "\n29,Male,4,78,Madipakkam\n");
- // show the toast
- Toast toast = new Toast(this);
- toast.setView(view);
- toast.setDuration(Toast.LENGTH_LONG);
- toast.show();
- }
- private View inflateView(int resource) {
- ViewInflate vi = (ViewInflate)getSystemService(Context.INFLATE_SERVICE);
- return vi.inflate(resource, null, null);
- }
- }
Parsed in 0.015 seconds, using GeSHi 1.0.8.4