mardi 19 mai 2015

putextra and getextra not passing string to next activity

I have three activities A,B,C

in my B activity i have one imageview,so if i get string from activity A to B,then imageview should be visible

if i get string from activity C to B then imageview should not be visible

 //From activity A
     Intent iin= getIntent();
        Bundle b = iin.getExtras();
        //From Activity C
        Intent i2=getIntent();
        Bundle abcd=i2.getExtras();

        if(b!=null)
        {
            String j =(String) b.get("arrowvisi");

            Toast.makeText(getApplicationContext(), j, Toast.LENGTH_LONG).show();
            if(j==b.get("arrowvisi"))
            {
                img_back.setVisibility(View.VISIBLE);
                Toast.makeText(getApplicationContext(), "Operational arrow visible", Toast.LENGTH_LONG).show();

            }
            else
            {
                if(abcd!=null)
                {
                    String jst =(String) abcd.get("arrow_val");
                    if(jst==abcd.get("arrow_val"))
                    {
                        img_back.setVisibility(View.GONE);
                        Toast.makeText(getApplicationContext(), "scan dispatch visble", Toast.LENGTH_LONG).show();
                    }
                    else
                    {
                        //img_back.setVisibility(View.GONE);

                        System.out.println("from scan dispatch");
                        Toast.makeText(getApplicationContext(), "scan dispatch not visible", Toast.LENGTH_LONG).show();
                    }

                }


                Toast.makeText(getApplicationContext(), "Operational not visible", Toast.LENGTH_LONG).show();
            }

        }

Aucun commentaire:

Enregistrer un commentaire