Hi,

i have button on the bottom of the layout..when i click on that a list will
appear..here if i click hardware backbutton it has to take to previous
activity but if i clik onthat the apps is crashing...if i click on the item
of the list it has to take to next activity..here its working fine......(the
list i made invisible in the xml layout)

so,after appearing the list if i click on back hardwae button its has to
take to previous activity....

public class Dialog extends Activity {

    private ListView lv1;


    private String lv_arr1[]= {"My projects","All projects"};

    public void onCreate(Bundle icicle)
    {
    super.onCreate(icicle);
    setContentView(R.layout.main);
    try {


lv1=(ListView)findViewById(R.id.ListView01);
lv1.setAdapter(new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr1));

lv1.setOnItemClickListener(new OnItemClickListener() {



    public void onItemClick(AdapterView<?> arg0, View arg1, int arg11, long
arg3) {
        // TODO Auto-generated method stub

        switch (arg11){
         case 0:
                  Intent intent=new Intent(Dialog.this,MyFavorites.class);

                    startActivity(intent);
                 break;

              case 1:
                  Intent intent1=new Intent(Dialog.this,MyProjects.class);

                  startActivity(intent1);
                 break;

              case 2:
                  Intent intent2=new Intent(Dialog.this,AllProjects.class);

                    startActivity(intent2);
                 break;}
    }
    }
final Button btn=(Button)findViewById(R.id.t1);
btn.setOnClickListener(new OnClickListener() {

    private View ListView01;
    private View ListView03;
    private View ListView02;

    public void onClick(View v) {
        // TODO Auto-generated method stub
         try {
             if (((Button) v).isClickable()) {
                 Button btn=(Button)findViewById(R.id.t1);

                 lv1.setVisibility(View.VISIBLE);


             }
                 else {

                         }
        } catch (Exception e) {
            // TODO: handle exception
        }

    }
});


Thanks in advance...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to