• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Question on Tab of the android

I have a Tab with class A and class B,

In class A i have a text and a button, when i add some value in text and press the button
it should display  the value in the activity  b with the tab, instead it displays only class b, not the tab

Any body can find out what is the issue
 
            Button rajset = (Button) findViewById(R.id.setappidButton);
            rajset.setOnClickListener(new OnClickListener() {

              public void onClick (View v) {

        
           Intent i = new Intent(A.this, B.class);
       
                EditText appIdStrVal = (EditText) findViewById(R.id.editText1);
                  String appIdStr = appIdStrVal.getEditableText().toString();
                 Log.d("Application ID", appIdStr + "");
                 i.putExtra("appIdStr", appIdStr);
                 startActivity(i);

In the B class i am having

  EditText appIdStrVal = (EditText) findViewById(R.id.editText1);
                appIdStr = appIdStrVal.getEditableText().toString();
                Log.d("Application ID", appIdStr + "");
          i.putExtra("appIdStr", appIdStr);
0
roy_sanu
Asked:
roy_sanu
1 Solution
 
GreggCommented:
Hi Roy,

Can you please post your code for class B. It appears you pasted the same code that is shown in Class A.

Thanks.
0
 
roy_sanuAuthor Commented:
Yes I have the class B code, still it is not showing the tab screen , but it shows me only the  class B screen layout.  

      String myApid;
      Intent i = getIntent();
      myApid = i.getStringExtra("appIdStr");
      myApid = appIdStr;
      Log.i(TAG, "getting app id from previous screen - " + myApid);
      Toast toast = Toast.makeText(InterstitialActivity.this, myApid, Toast.LENGTH_SHORT);
      toast.show();
0
 
SanthanaTechnical LeadCommented:
Hi,
(Try to attache the clean and full code..so that we can help easily)      

     String myApid;
      Intent i = getIntent();
      myApid = i.getStringExtra("appIdStr");
      myApid = appIdStr;
      Log.i(TAG, "getting app id from previous screen - " + myApid);
      Toast toast = Toast.makeText(InterstitialActivity.this, myApid, Toast.LENGTH_SHORT);
      toast.show();

From your code you are getting the string from the intent and its assigned with the variable "myApid " . But again you are assigning  with the "appIdStr".
myApid = appIdStr;

So please check this.

Regards
Santhana
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now