Sending data between activities

2020-02-16 02:44发布

问题:

How to send data between two activities?I have the following code, but I only get null in the receiver activity:

The activity from which I send data:

Intent intent = new Intent(SecondScreen.this, ThirdScreen.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);//clear previous activities
                intent.putExtra("CLIENT_ID", getUserID);
                intent.putExtra("PASSWORD", getUserPWD);
                startActivity(intent);

The activity where I want to receive data:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_third_screen);
Bundle b = getIntent().getExtras(); 
    if (b != null)
    {
        CLIENT_ID =  b.getString("CLIENT_ID"); 
        CLIENT_PWD =  b.getString("PASSWORD"); 
    }

So what am I doing wrong?

UPD here is LogCat:

03-07 12:04:10.340: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, 

error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:10.340: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:10.661: E/Settings:###(16748): onApplyThemeResource...
03-07 12:04:11.021: E/SurfaceTexture(1451): [AtchDlg:com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:11.492: E/SurfaceTexture(1451): [SurfaceView] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:04:11.502: E/SurfaceTexture(1451): [com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:04:12.753: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:13.744: E/Settings:###(16748): onApplyThemeResource...
03-07 12:04:13.784: E/HtcPreferenceActivity(16748): context.getClassLoader(): dalvik.system.PathClassLoader[/system/app/Settings.apk]
03-07 12:04:13.784: E/HtcPreferenceActivity(16748): context.getPackageName(): com.android.settings
03-07 12:04:13.784: E/HtcPreferenceActivity(16748): context.getPackageCodePath(): /system/app/Settings.apk
03-07 12:04:13.784: E/HtcPreferenceActivity(16748): context.getPackageResourcePath(): /system/app/Settings.apk
03-07 12:04:13.784: E/HtcPreferenceActivity(16748): fragmentName: com.android.settings.DisplaySettings
03-07 12:04:14.194: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:14.244: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:14.494: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:14.504: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:14.565: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.Settings] abandon: SurfaceTexture(0x0x2668c0) has been abandoned!
03-07 12:04:18.699: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SubSettings] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:04:19.870: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SubSettings] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:22.382: E/Adreno200-ES20(4154): <process_gl_state_enables:456>: GL_INVALID_ENUM
03-07 12:04:22.592: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.Settings] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:04:26.626: E/Wifi_Pair(17131): Error occured while reading paired Winamp Ids.
03-07 12:04:30.510: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.890: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.910: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.931: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.931: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.941: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.941: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:30.941: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.021: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.031: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.071: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.091: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.131: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.131: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.261: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.541: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.541: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.571: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:31.721: E/ConversionPing(17280): ConversionPing could not reach the url, no conversion sent.
03-07 12:04:32.312: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:32.322: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:32.802: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:04:38.268: E/Settings:###(16748): onApplyThemeResource...
03-07 12:04:38.768: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:38.798: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:38.858: E/SurfaceTexture(1451): [SurfaceView] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:38.868: E/SurfaceTexture(1451): [com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:04:42.922: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:42.932: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:43.032: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SoundSettings] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:44.474: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): false
03-07 12:04:44.474: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): true
03-07 12:04:44.474: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): false
03-07 12:04:44.474: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): true
03-07 12:04:44.474: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): false
03-07 12:04:44.484: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): true
03-07 12:04:44.484: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): false
03-07 12:04:44.484: E/AudioService(1593): [AudioHandler] syncSetIndex Call setStreamVolumeIndex isHeadsetPlugged(): true
03-07 12:04:44.704: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:44.724: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SoundSettings] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:44.754: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:47.817: E/AudioHardwareMSM7X30(1454): output is hw device
03-07 12:04:50.049: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:50.059: E/SettingsMobileDataEnabler(16748): mSummary is null!!
03-07 12:04:50.229: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SoundSettings] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:04:52.632: E/Adreno200-ES20(4154): <process_gl_state_enables:456>: GL_INVALID_ENUM
03-07 12:04:52.932: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SoundSettings] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:06:23.173: E/SurfaceTexture(1451): [com.htc.clock3dwidget.idlescreen.IdleScreenClockService] abandon: SurfaceTexture(0x0x225988) has been abandoned!
03-07 12:18:19.071: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:18:19.142: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:18:19.262: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:18:19.272: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:21:59.930: E/Adreno200-ES20(4154): <process_gl_state_enables:456>: GL_INVALID_ENUM
03-07 12:22:00.541: E/Wifi_SyncServer(17131): Error occurred while accepting client request.
03-07 12:22:00.541: E/Wifi_SyncServer(17131): java.net.SocketException: Socket closed
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at libcore.io.Posix.accept(Native Method)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at java.net.ServerSocket.implAccept(ServerSocket.java:202)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at java.net.ServerSocket.accept(ServerSocket.java:127)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at com.nullsoft.winamp.wifi.b.run(SourceFile:89)
03-07 12:22:00.541: E/Wifi_SyncServer(17131):   at java.lang.Thread.run(Thread.java:864)
03-07 12:22:03.534: E/mode10(1730): Scene container cannot bind null scene
03-07 12:22:03.784: E/SurfaceTexture(1451): [Keyguard] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:06.617: E/SurfaceTexture(1451): [AtchDlg:com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:06.667: E/SurfaceTexture(1451): [SurfaceView] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:22:06.697: E/SurfaceTexture(1451): [com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:08.328: E/Settings:###(16748): onApplyThemeResource...
03-07 12:22:08.348: E/HtcPreferenceActivity(16748): context.getClassLoader(): dalvik.system.PathClassLoader[/system/app/Settings.apk]
03-07 12:22:08.348: E/HtcPreferenceActivity(16748): context.getPackageName(): com.android.settings
03-07 12:22:08.348: E/HtcPreferenceActivity(16748): context.getPackageCodePath(): /system/app/Settings.apk
03-07 12:22:08.348: E/HtcPreferenceActivity(16748): context.getPackageResourcePath(): /system/app/Settings.apk
03-07 12:22:08.348: E/HtcPreferenceActivity(16748): fragmentName: com.android.settings.DevelopmentSettings
03-07 12:22:08.418: E/Cryptfs(1445): not running with encryption, aborting
03-07 12:22:08.759: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.Settings] abandon: SurfaceTexture(0x0x2668c0) has been abandoned!
03-07 12:22:10.881: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SubSettings] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:11.732: E/Adreno200-ES20(4154): <process_gl_state_enables:456>: GL_INVALID_ENUM
03-07 12:22:12.032: E/SurfaceTexture(1451): [com.android.settings/com.android.settings.SubSettings] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:22:14.985: E/wpa_supplicant(17696): Starting wpa_supplicant...
03-07 12:22:17.688: E/wpa_supplicant(17696): ioctl[SIOCSIWPRIV] (cscan): -1
03-07 12:22:17.938: E/WifiConfigStore(1593): Missing id while parsing configuration
03-07 12:22:17.938: E/WifiConfigStore(1593): Missing id while parsing configuration
03-07 12:22:17.938: E/WifiConfigStore(1593): Missing id while parsing configuration
03-07 12:22:18.048: E/wpa_supplicant(17696): ioctl[SIOCSIWPRIV] (cscan): -1
03-07 12:22:27.737: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:31.741: E/SurfaceTexture(1451): [SurfaceView] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:31.831: E/SurfaceTexture(1451): [com.htc.launcher/com.htc.launcher.Launcher] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:32.352: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:32.362: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:37.016: E/SurfaceTexture(1451): [Waiting For Debugger] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:40.149: E/SurfaceTexture(1451): [Starting com.vladimir.expert_suise] abandon: SurfaceTexture(0x0x24b350) has been abandoned!
03-07 12:22:44.323: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:44.334: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:44.334: E/Icing(18131): Not enough disk space. Will not index.
03-07 12:22:45.314: E/SurfaceTexture(1451): [com.vladimir.expert_suise/com.vladimir.expert_suise.FirstScreen] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:45.415: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:46.426: E/AbstractCompatWrapper(1785): Invalid input to AbstructCompatWrapper
03-07 12:22:46.426: E/CompatUtils(1785): Exception in invoke: NullPointerException
03-07 12:22:47.366: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.366: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.386: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.477: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.577: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.597: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.607: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:47.627: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:48.357: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:48.628: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:48.918: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:49.238: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:49.529: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:49.819: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:49.829: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:49.849: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.009: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.019: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.029: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.039: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.049: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.099: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.109: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.379: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:50.379: E/SurfaceTexture(1451): [InputMethod] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:50.620: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.620: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.780: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:50.910: E/AbstractCompatWrapper(1785): Invalid input to AbstructCompatWrapper
03-07 12:22:50.910: E/CompatUtils(1785): Exception in invoke: NullPointerException
03-07 12:22:51.330: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:51.410: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:52.602: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:53.202: E/SurfaceTexture(1451): [PopupWindow:4143a148] abandon: SurfaceTexture(0x0x264140) has been abandoned!
03-07 12:22:53.212: E/SurfaceTexture(1451): [InputMethod] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:22:54.834: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:54.844: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:54.854: E/SqliteDatabaseCpp(3028): native_1x1_string (step): errno = 2, error message = No such file or directory, path = /data/data/com.google.android.gsf/databases , key = cwevragew, handle = 0x1eb6250
03-07 12:22:56.265: E/SurfaceTexture(1451): [PopupWindow:40e0d440] abandon: SurfaceTexture(0x0x250738) has been abandoned!
03-07 12:24:37.604: E/SurfaceTexture(1451): [com.vladimir.expert_suise/com.vladimir.expert_suise.SecondScreen] abandon: SurfaceTexture(0x0x24b350) has been abandoned!

回答1:

Assuming that you have a values in your string while passing into putExtra, check below piece of code and if you are doing same way, damn sure it will give your perfect result else you doing wrong somewhere else.

MainActivity.java

String getUserID="I am new bee";
 String getUserPWD="Let me google it";


 Intent intent = new Intent(MainActivity.this, SecondActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);//clear previous activities
         intent.putExtra("CLIENT_ID", getUserID);
         intent.putExtra("PASSWORD", getUserPWD);
         startActivity(intent);

SecondActivity.java

String CLIENT_ID="";
 String CLIENT_PWD="";

         Bundle b = getIntent().getExtras(); 
            if (b != null)
            {
                CLIENT_ID =  b.getString("CLIENT_ID"); 
                CLIENT_PWD =  b.getString("PASSWORD"); 
            }

            Log.d("^^^^^", "CLIENT_ID="+CLIENT_ID);
            Log.d("^^^^^", "CLIENT_PWD="+CLIENT_PWD);

Output:

03-10 10:30:59.946: D/^^^^^(10974): CLIENT_ID=I am new bee
03-10 10:30:59.946: D/^^^^^(10974): CLIENT_PWD=Let me google it

I am sure your String is null while passing, simple print out when calling Intent.



回答2:

Current Activity

Intent intent = new Intent(Current.this, Next.class);
intent.putExtra("user", "admin");
intent.putExtra("pass", "123");
startActivity(intent);

Next Activity

Intent intent = getIntent();
String user = intent.getExtras().getString("user");
String option = intent.getExtras().getString("pass");


回答3:

You have to do something like this in your second activity:

if(getIntent().hasExtras("CLIENT_ID") && getIntent().hasExtras("PASSWORD"))
{
    getIntent().getStringExtra("CLIENT_ID");
    getIntent().getStringExtra("PASSWORD");
}


回答4:

I've tried your exact code and its working fine ..

Make sure that the CLIENT_ID and PASSWORD are not Null in the first place and in the first Activity by inserting this line in both activities and tracing the log

Log.d("Your Data ", ">>>>>" + CLIENT_ID + "//" + CLIENT_PWD);



回答5:

You are passing a bundle, so you should try this in the first activity:

Intent intent = new Intent(SecondScreen.this, ThirdScreen.class);
Bundle bundle = new Bundle();
bundle.putString("CLIENT_ID", getUserID);
bundle.putString("PASSWORD", getUserPWD);
intent.putExtras(bundle);
startActivity(intent);