java - How to append to a String and send through intents in Android? -


I am trying to add value to a string and then send it to the next activity. Here is the only relevant part of the code: Adding () is the ID of the button that adds the value of string message and sendMessage () , the message Sends it completely. When I send only a dummy value, the message is being passed, even when I add 1,2,3,4,5 to a bar instead of adding it, it goes away But when I try to add, attach it then send it, it gives me a "unfortunate shutdown" error

I made many changes, but still this is the error, how is it right? Do you?

  Adding Public Zero (see View) {EditText at 1 = (Edit Text) SearchVBIID (RID Edit Text 1); . Msg = msg + "," + et1.getText () toString (); TextView tv1 = (TextView) findViewById (R.id.textView1); Tv1.setText (MSG); Et1.setText (""); } Public Zero send message (see footage) {intention intended = new intent (this, next category); Message + = ""; Intent.putExtra ("Message", msg); StartActivity; }   



Edit: activity code-

  package com Example. New list; Import android.content.Intent; Importroid.os.Bundle; Import android.support.v7.app.ActionBarActivity; Import android.view.Menu; Import android.view.MenuItem; Import android.view.View; Import android.widget.EditText; Import android.widget.TextView; Public Class Main Activity ActionBarActivity Extension [String msg = ""; Int count = 0; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); SetContentView (R.layout.activity_main); } @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Enhancing Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fluo (R. menu menu, menu); Back true; } @ Override Public Boolean On Option Itam Select (menu item) {// Handle action bar item here clicks the action bar will automatically click on the Home / Up button, so long as you // in AndroidManifest.xml Specify basic activity. Int id = item.getItemId (); If (id == R.id.action_settings) {return true; } Return Super.Options item selected (item); } Adding Public Zero (see View) {EditText at 1 = (Edit Text) SearchVBIID (RIDAditat1); . Msg = msg + "," + et1.getText () toString (); TextView tv1 = (TextView) findViewById (R.id.textView1); Tv1.setText (MSG); Et1.setText (""); } Public Zero send message (see footage) {intention intended = new intent (this, next category); Message + = ""; Intent.putExtra ("Message", msg); StartActivity;  

Of course I understand your question correctly

  1. Take your search to turn VivById on

      EditText et1; TextView TV1; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); SetContentView (R.layout.activity_main); At 1 = (Editing Text) SearchVBIID (RIDAdactText1); Tv1 = (TextView) Find VVBIID (RaidtextVV1);  
  2. + Et1.gettext () ToString (); Last string showMessage = msg; Tv1.setText (ShowMessage); Et1.setText ("");

  3. In the message you sent

      send a public null message (see the view) {intent intention = new intent (this, Next class); Message + = ""; Last string msgThatWillSend = msg; Intent.putExtra ("Message", msgThatWillSend); StartActivity; }     

    has not tested yet, but it should work

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -