title: TextView cannot intent to another class even it is not null
body: <p>I have Activity A and B. 
  Activity A has <code>textView</code> and a <code>button</code>.
  Activity B has one <code>textView</code> and one <code>editText</code>.</p>
  
  <p>What I trying to achieve is let the <code>c</code> in Activity A clickable if it is not null.</p>
  
  <p>When it is in Activity A, it display <code>null</code>. When I click the <code>button</code> to intent B and return <code>result</code> and <code>name</code> to A, it should display <code>not null</code> and can <code>intent</code> to <code>EditClaims.java</code> if <code>c</code> is clicked. </p>
  
  <p>But the problem now is it <strong>didn't</strong> display <code>not null</code> when it is return <code>result</code> and <code>name</code> from B to A and not <code>intent</code> to <code>EditClaims.java</code> when <code>c</code> is click.</p>
  
  <p>So this is how the activity's flow should look like</p>
  
  <p>Activity A >> display null >> Button click >> Go to B >> return <code>result</code> and <code>name</code> from B  to A >> display not null >> go to <code>EditClaims.java</code> if <code>c</code> is clicked.</p>
  
  <pre><code>      String result="";
                  String name=""
                   public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                               Bundle savedInstanceState) {
                          super.onCreate(savedInstanceState);
                          Bundle bundle = this.getArguments();
                    View claims = inflater.inflate(R.layout.claims, container, false);
                    c = (TextView) claims.findViewById(R.id.textView49);
                    Button button1 = (Button) claims.findViewById(R.id.button10);
  
                    button1.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      // Toast.makeText(getActivity().getApplicationContext(), fk + "", Toast.LENGTH_LONG).show();
                      AlertDialogRadio(a1);
  
  
                  }
              });
  
       public void AlertDialogRadio(final int k) {
               final CharSequence[] ClaimsModel = {"B", "C", "D"};
  
              AlertDialog.Builder alt_bld = new AlertDialog.Builder(getActivity());
              alt_bld.setTitle("Select a Claims");
              alt_bld.setSingleChoiceItems(ClaimsModel, -1, new DialogInterface
                      .OnClickListener() {
  
                  public void onClick(DialogInterface dialog, int item) {
                      if (item == 0) {
                          Intent intent = new Intent(getActivity().getApplicationContext(), B.class);
                          startActivityForResult(intent, 0);
                      } else if (item == 1) {...} 
                                     .....
  
                      });
  
              }
                   if ((name != null &amp;&amp; name.trim().length() &gt; 0) &amp;&amp; (result != null &amp;&amp; result.trim().length() &gt; 0)) { // check whether c is null or not null
                              Toast.makeText(getActivity().getApplicationContext(),  "not null", Toast.LENGTH_LONG).show();
                              c.setOnClickListener(new View.OnClickListener() {
                                  @Override
                                  public void onClick(View v) {
                                      Intent intent = new Intent(getActivity(), EditClaims.class);
                                      startActivity(intent);
                                  }
                              });
                          }else
                          {
                              Toast.makeText(getActivity().getApplicationContext(),  "null", Toast.LENGTH_LONG).show();
                          }
  
  
  
  
                              }
                          });
                   return claims;
                      }
  
          @Override
              public void onActivityResult(int requestCode, int resultCode, Intent data)
    int button = data.getIntExtra("k1", 0); 
   {
  
                  if (button == 1) {
                      switch (requestCode) {
                          case 0:
                              result = data.getStringExtra("text"); // return from B
                              name = data.getStringExtra("a"); //return from B
                              as=Long.parseLong(result);
                              c.setText("            " + name + "------" + "RM " + result);
                              break;
  </code></pre>
  
  <p><strong>Activity B</strong></p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.B);
          txt = (EditText) findViewById(R.id.editText36);
          txt1=(TextView)findViewById(R.id.textView57);
          Button b = (Button) findViewById(R.id.button17);
          addListenerOnButton();
  
  
          b.setOnClickListener(new View.OnClickListener() {  // save button
              public void onClick(View arg0) {
                  Intent returnIntent = new Intent();
                  a = "Project";
                  text = txt.getText().toString();
                  returnIntent.putExtra("text", text);
                  returnIntent.putExtra("a", a);
                  setResult(Activity.RESULT_OK, returnIntent);
                  finish();
              }
          });
  
      }
  </code></pre>