android - String content from dialog popup feeding into EditText field -


I'm trying to make a feature that lets the user enters a name in a popup dialog box, enter The name given is automatically fed through an edit text field on the next page, such as requesting a title name, followed by the title of the next page. The dialog popup part is working, but I want to get the value stored in the 'm_Text' string variable which is in the edit text field. Someone please help me !!!

Here is the code for the page on which the dialog box is called ....

  package com.evicapture.loadsave; // import com.example.camerademo.R; Import android App Import android.app.AlertDialog; Import android.content.DialogInterface; Import android.content.Intent; Importroid.os.Bundle; Import android.text.InputType; Import android.view.View; Import android.widget.Button; Import android.widget.EditText; Public class introMenu activity {public static string m_Text = "" extends; Override public null at @reate (bundle saved instenestate) {// TODO auto generated method stub super. Connet (Saved Instantstate); SetContentView (R.layout.intro); Button next = (button) Find ViewById (R.id.NewCase); next.setOnClickListener (New View.OnClickListener) Click on {@Override Public Zero (click view) {AlertDialog.Builder Builder = New AlertDialog.Builder (IntroMenu.this); Builder.settail ("Case name / not included "Last editable tap input = new edit test (IntroMenu.this); input.set input type (InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL); builder.setview; builder .setupsit button (" OK ", New DialogInterface.OnClickListener ( ) {@Override public void onClick (DialogInterface dialog, int which) {m_Text = input.getText (). toString (); effect myIntent = new coming If ( "com.evicapture.loadsave.CASEINFO"); startActivityForResult (myIntent, 0);}}); builder.setNegativeButton ( "Cancel", new DialogInterface.OnClickListener () {@Override on public void (DialogInterface communicate , int) {dialog.cancel ();}}); builder.show ();}}); }   

And with code editing text field to field ....

  Package com.evicapture.loadsave; // import com.example.camerademo.R; Import android App Import android.content.Intent; Importroid.os.Bundle; Import android.view.View; Import android.widget.Button; Import android.widget.EditText; Import android.widget.TextView; Public category affairs activity is extracted {edit test etCaseName not; @ Override Protected Zero (InstanceStat saved from bundle) {// Todo auto-generated method stub super. Connet (Saved Instantstate); SetContentView (R.layout.case_info_form); etCaseNameNo = (EditText) findViewById (R.id.tvCaseNameNo); EtCaseNameNo.setText (IntroMenu.m_Text); Button Next = (Button) Find ViewById (Rid.Back1); next.setOnClickListener (Click ViewOnClickListener {@Override Public Zero (see View)} {myIntent = New Intent (see .getContext (), IntroMenu.class); startActivityForResult (myIntent, 0);}}) ; If} something else is important, please ask .. I am new to Android programming, and I am struggling, please be kind ..  

Thank you!

You must have m_text (string) through the effect.

If you use it:

: Add the extended data refers

  Last String message = "com.evicapture.loadsave.username"; m_Text = input.getText () toString (); MyIntent = new intent ("com.evicapture.loadsave.CASEINFO"); MyIntent.putExtra (message, strName); StartActivityForResult (myIntent, 0);   

You can use the Recharge for:

  extra = getIntent (). GetExtras (); If (extra == faucet) {newString = null; } And {newString = extras.getString (message); } EtCaseNameNo.setText (newString);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -