Note that there are some explanatory texts on larger screens.

plurals
  1. POintent is not returning data
    primarykey
    data
    text
    <p>I am developing an Android project in which I have to send data from one activity to another. But when I'm sending data from one activity to another it is not sending data from one activity to another. </p> <p>Part of code receiving data from other is:</p> <pre><code>Intent intent=getIntent(); String str,str1; str=intent.getExtras().getString("phoneno"); Log.d("completre", "complete"); phonePhoneno.setText(str); Log.d("complete","complete1"); if(intent.getExtras()==null) { txtMessage.setText("u duffer write program properly"); } else { str1=intent.getExtras().toString(); txtMessage.setText(str1); Log.d("complete","complete2"); } </code></pre> <p>Part of code I'm using for sending data from other activity is:</p> <pre><code>if(v.getId()==R.id.main_act) { String str=txtText.getText().toString(); Intent intent=new Intent(getApplicationContext(), MainActivity.class); intent.putExtra("username",str); intent.putExtra("phoneno", phoneno); startActivity(intent); } </code></pre> <p>When I try to receive data by clicking button it is force closing.</p> <p>in this project i have two activity in first activity i m reading a telephone no. ans sending it to second activity only to save it for future. in the second activity i have an edit text in which i am adding text by voice recognition system after that i am sending both data telephone no and edit text field from 2nd activity to 1st activity by clcking button just shown above (in second part of code) . it is sending phone no but not edit text content(guess) , when i click complete button(to fill both field in 1st activity) then it adds phone no in phone no field but does not add message.</p> <p>latest log cat when app didn't close itself </p> <pre><code> 04-13 13:33:46.206: I/TextToSpeech(834): Sucessfully bound to com.svox.pico 04-13 13:33:46.206: W/TextToSpeech(834): speak failed: not bound to TTS engine 04-13 13:33:47.005: I/TextToSpeech(834): Connected to ComponentInfo{com.svox.pico/com.svox.pico.PicoService} 04-13 13:33:47.125: E/test(834): hhhhhhhhhhhhhhhhh 04-13 13:33:47.125: I/Choreographer(834): Skipped 174 frames! The application may be doing too much work on its main thread. 04-13 13:33:47.575: I/Choreographer(834): Skipped 69 frames! The application may be doing too much work on its main thread. 04-13 13:33:56.535: W/IInputConnectionWrapper(834): showStatusIcon on inactive InputConnection 04-13 13:33:56.535: I/Choreographer(834): Skipped 174 frames! The application may be doing too much work on its main thread. 04-13 13:33:56.975: D/dalvikvm(834): GC_CONCURRENT freed 127K, 9% free 3017K/3288K, paused 37ms+5ms, total 108ms 04-13 13:34:00.274: V/(834): Got a contact result: content://com.android.contacts/data/3 04-13 13:34:00.674: V/(834): Got phone no : (986) 743-561 04-13 13:34:00.914: I/Choreographer(834): Skipped 164 frames! The application may be doing too much work on its main thread. 04-13 13:34:01.244: I/Choreographer(834): Skipped 37 frames! The application may be doing too much work on its main thread. 04-13 13:34:05.494: I/Choreographer(834): Skipped 139 frames! The application may be doing too much work on its main thread. 04-13 13:34:05.974: I/Choreographer(834): Skipped 60 frames! The application may be doing too much work on its main thread. 04-13 13:34:12.965: I/TextToSpeech(834): Sucessfully bound to com.svox.pico 04-13 13:34:12.965: W/TextToSpeech(834): speak failed: not bound to TTS engine 04-13 13:34:13.065: I/TextToSpeech(834): Connected to ComponentInfo{com.svox.pico/com.svox.pico.PicoService} 04-13 13:34:13.155: E/test(834): hhhhhhhhhhhhhhhhh 04-13 13:34:13.155: I/Choreographer(834): Skipped 35 frames! The application may be doing too much work on its main thread. 04-13 13:34:14.425: I/Choreographer(834): Skipped 308 frames! The application may be doing too much work on its main thread. 04-13 13:34:15.235: I/Choreographer(834): Skipped 95 frames! The application may be doing too much work on its main thread. 04-13 13:34:16.265: I/Choreographer(834): Skipped 31 frames! The application may be doing too much work on its main thread. 04-13 13:34:20.025: D/completre(834): complete 04-13 13:34:20.035: D/AndroidRuntime(834): Shutting down VM 04-13 13:34:20.035: W/dalvikvm(834): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 04-13 13:34:20.085: E/AndroidRuntime(834): FATAL EXCEPTION: main 04-13 13:34:20.085: E/AndroidRuntime(834): java.lang.NullPointerException 04-13 13:34:20.085: E/AndroidRuntime(834): at com.example.sms.MainActivity.onClick(MainActivity.java:322) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.view.View.performClick(View.java:4204) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.view.View$PerformClick.run(View.java:17355) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.os.Handler.handleCallback(Handler.java:725) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.os.Handler.dispatchMessage(Handler.java:92) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.os.Looper.loop(Looper.java:137) 04-13 13:34:20.085: E/AndroidRuntime(834): at android.app.ActivityThread.main(ActivityThread.java:5041) 04-13 13:34:20.085: E/AndroidRuntime(834): at java.lang.reflect.Method.invokeNative(Native Method) 04-13 13:34:20.085: E/AndroidRuntime(834): at java.lang.reflect.Method.invoke(Method.java:511) 04-13 13:34:20.085: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 04-13 13:34:20.085: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 04-13 13:34:20.085: E/AndroidRuntime(834): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>i more thing that i would like to mention here is that when i return from second activity to main without recording any message that i didn't set content of edit text and i tried to send the content to first activity as shown in second part of code it worked ...ideally it should force close itself since edit text had no data ..i could not understand why it is not force closing itself at that time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload