This is my code:
package com.example.userpage;
import android.app.Activity;
import android.content.Intent;
import android.
os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class UserPage extends Activity {
String tv,tv1;
EditText name,pass;
TextView
x,y;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button = (Button) findViewById(R.id.widget44);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
name.setText(" ");
pass.setText(" ");
}
});
x = (TextView) findViewById(R.id.widget46);
y = (TextView) findViewById(R.id.widget47);
name = (EditText)findViewById(R.id.widget41);
pass = (EditText)findViewById(R.id.widget42);
Button button1 = (Button) findViewById(R.id.widget45);
button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
tv= name.getText().toString();
tv1 = pass.getText().toString();
x.setText(tv);
y.setText(tv1);
}
});
}
}
And this is my log cat:
02-16 12:24:30.488: DEBUG/AndroidRuntime(973): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:24:30.488: DEBUG/AndroidRuntime(973): CheckJNI is ON
02-16 12:24:31.208: DEBUG/AndroidRuntime(973): --- registering native functions ---
02-16 12:24:33.498: DEBUG/AndroidRuntime(973): Shutting down VM
02-16 12:24:33.537: DEBUG/dalvikvm(973): Debugger has detached; object registry had 1 entries
02-16 12:24:33.537: INFO/AndroidRuntime(973): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:24:34.917: DEBUG/AndroidRuntime(981): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:24:34.927: DEBUG/AndroidRuntime(981): CheckJNI is ON
02-16 12:24:35.617: DEBUG/AndroidRuntime(981): --- registering native functions ---
02-16 12:24:38.029: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.userpage/.UserPage }
02-16 12:24:38.129: DEBUG/AndroidRuntime(981): Shutting down VM
02-16 12:24:38.160: DEBUG/dalvikvm(981): Debugger has detached; object registry had 1 entries
02-16 12:24:38.168: INFO/AndroidRuntime(981): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:25:12.028: DEBUG/AndroidRuntime(990): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:25:12.038: DEBUG/AndroidRuntime(990): CheckJNI is ON
02-16 12:25:12.708: DEBUG/AndroidRuntime(990): --- registering native functions ---
02-16 12:25:15.178: DEBUG/dalvikvm(176): GC_EXPLICIT freed 114 objects / 5880 bytes in 115ms
02-16 12:25:15.318: DEBUG/PackageParser(67): Scanning package: /data/app/vmdl25170.tmp
02-16 12:25:15.588: INFO/PackageManager(67): Removing non-system package:com.example.userpage
02-16 12:25:15.597: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:25:15.648: INFO/Process(67): Sending signal. PID: 916 SIG: 9
02-16 12:25:15.877: INFO/UsageStats(67): Unexpected resume of com.android.launcher while already resumed in com.example.userpage
02-16 12:25:17.028: WARN/InputManagerService(67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4400ecf8
02-16 12:25:17.928: DEBUG/PackageManager(67): Scanning package com.example.userpage
02-16 12:25:17.949: INFO/PackageManager(67): Package com.example.userpage codePath changed from /data/app/com.example.userpage-1.apk to /data/app/com.example.userpage-2.apk; Retaining data and using new
02-16 12:25:17.987: INFO/PackageManager(67): /data/app/com.example.userpage-2.apk changed; unpacking
02-16 12:25:18.037: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.example.userpage-2.apk' ---
02-16 12:25:18.737: DEBUG/dalvikvm(997): DexOpt: load 81ms, verify 112ms, opt 6ms
02-16 12:25:18.768: DEBUG/installd(35): DexInv: --- END '/data/app/com.example.userpage-2.apk' (success) ---
02-16 12:25:18.799: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:25:18.808: WARN/PackageManager(67): Code path for pkg : com.example.userpage changing from /data/app/com.example.userpage-1.apk to /data/app/com.example.userpage-2.apk
02-16 12:25:18.839: WARN/PackageManager(67): Resource path for pkg : com.example.userpage changing from /data/app/com.example.userpage-1.apk to /data/app/com.example.userpage-2.apk
02-16 12:25:18.868: DEBUG/PackageManager(67): Activities: com.example.userpage.UserPage
02-16 12:25:19.297: INFO/installd(35): move /data/dalvik-cache/data@
[email protected]@classes.dex -> /data/dalvik-cache/data@
[email protected]@classes.dex
02-16 12:25:19.297: DEBUG/PackageManager(67): New package installed in /data/app/com.example.userpage-2.apk
02-16 12:25:19.598: DEBUG/dalvikvm(67): GC_FOR_MALLOC freed 7979 objects / 516856 bytes in 246ms
02-16 12:25:20.498: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:25:20.708: DEBUG/dalvikvm(129): GC_EXPLICIT freed 124 objects / 5672 bytes in 157ms
02-16 12:25:21.838: DEBUG/dalvikvm(67): GC_EXPLICIT freed 4208 objects / 236264 bytes in 419ms
02-16 12:25:21.918: WARN/RecognitionManagerService(67): no available voice recognition services found
02-16 12:25:22.127: INFO/installd(35): unlink /data/dalvik-cache/data@
[email protected]@classes.dex
02-16 12:25:22.478: DEBUG/AndroidRuntime(990): Shutting down VM
02-16 12:25:22.488: DEBUG/dalvikvm(990): Debugger has detached; object registry had 1 entries
02-16 12:25:22.588: INFO/AndroidRuntime(990): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:25:24.137: DEBUG/AndroidRuntime(1003): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:25:24.147: DEBUG/AndroidRuntime(1003): CheckJNI is ON
02-16 12:25:24.817: DEBUG/AndroidRuntime(1003): --- registering native functions ---
02-16 12:25:27.450: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.userpage/.UserPage }
02-16 12:25:27.628: DEBUG/AndroidRuntime(1003): Shutting down VM
02-16 12:25:27.780: INFO/AndroidRuntime(1003): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:25:28.018: DEBUG/dalvikvm(1003): Debugger has detached; object registry had 1 entries
02-16 12:25:28.148: INFO/ActivityManager(67): Start proc com.example.userpage for activity com.example.userpage/.UserPage: pid=1010 uid=10036 gids={}
02-16 12:25:30.308: DEBUG/AndroidRuntime(1010): Shutting down VM
02-16 12:25:30.308: WARN/dalvikvm(1010): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): FATAL EXCEPTION: main
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.userpage/com.example.userpage.UserPage}: java.lang.ClassCastException: android.widget.TextView
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.
os.Handler.dispatchMessage(Handler.java:99)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.
os.Looper.loop(Looper.java:123)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at java.lang.reflect.Method.invokeNative(Native Method)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at java.lang.reflect.Method.invoke(Method.java:521)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at com.android.internal.
os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at com.android.internal.
os.ZygoteInit.main(ZygoteInit.java:626)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at dalvik.system.NativeStart.main(Native Method)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): Caused by: java.lang.ClassCastException: android.widget.TextView
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at com.example.userpage.UserPage.onCreate(UserPage.java:35)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-16 12:25:30.388: ERROR/AndroidRuntime(1010): ... 11 more
02-16 12:25:30.438: WARN/ActivityManager(67): Force finishing activity com.example.userpage/.UserPage
02-16 12:25:31.088: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{43f164f8 com.example.userpage/.UserPage}
02-16 12:25:32.588: DEBUG/dalvikvm(292): GC_EXPLICIT freed 46 objects / 2240 bytes in 6282ms
02-16 12:25:35.267: INFO/Process(1010): Sending signal. PID: 1010 SIG: 9
02-16 12:25:35.468: WARN/InputManagerService(67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e60a90
02-16 12:25:35.900: INFO/ActivityManager(67): Process com.example.userpage (pid 1010) has died.
02-16 12:25:38.278: DEBUG/dalvikvm(176): GC_EXPLICIT freed 172 objects / 12280 bytes in 127ms
02-16 12:25:43.011: WARN/ActivityManager(67): Activity destroy timeout for HistoryRecord{43f164f8 com.example.userpage/.UserPage}
02-16 12:28:12.698: DEBUG/AndroidRuntime(1019): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:28:12.711: DEBUG/AndroidRuntime(1019): CheckJNI is ON
02-16 12:28:13.367: DEBUG/AndroidRuntime(1019): --- registering native functions ---
02-16 12:28:15.998: DEBUG/dalvikvm(176): GC_EXPLICIT freed 114 objects / 5888 bytes in 183ms
02-16 12:28:16.539: DEBUG/PackageParser(67): Scanning package: /data/app/vmdl25171.tmp
02-16 12:28:16.867: INFO/PackageManager(67): Removing non-system package:com.example.userpage
02-16 12:28:16.867: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:28:17.277: DEBUG/PackageManager(67): Scanning package com.example.userpage
02-16 12:28:17.308: INFO/PackageManager(67): Package com.example.userpage codePath changed from /data/app/com.example.userpage-2.apk to /data/app/com.example.userpage-1.apk; Retaining data and using new
02-16 12:28:17.328: INFO/PackageManager(67): /data/app/com.example.userpage-1.apk changed; unpacking
02-16 12:28:17.367: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/com.example.userpage-1.apk' ---
02-16 12:28:18.357: DEBUG/dalvikvm(1026): DexOpt: load 85ms, verify 114ms, opt 6ms
02-16 12:28:18.398: DEBUG/installd(35): DexInv: --- END '/data/app/com.example.userpage-1.apk' (success) ---
02-16 12:28:18.428: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:28:18.438: WARN/PackageManager(67): Code path for pkg : com.example.userpage changing from /data/app/com.example.userpage-2.apk to /data/app/com.example.userpage-1.apk
02-16 12:28:18.477: WARN/PackageManager(67): Resource path for pkg : com.example.userpage changing from /data/app/com.example.userpage-2.apk to /data/app/com.example.userpage-1.apk
02-16 12:28:18.477: DEBUG/PackageManager(67): Activities: com.example.userpage.UserPage
02-16 12:28:18.977: INFO/installd(35): move /data/dalvik-cache/data@
[email protected]@classes.dex -> /data/dalvik-cache/data@
[email protected]@classes.dex
02-16 12:28:18.988: DEBUG/PackageManager(67): New package installed in /data/app/com.example.userpage-1.apk
02-16 12:28:19.528: DEBUG/dalvikvm(67): GC_FOR_MALLOC freed 6733 objects / 459728 bytes in 211ms
02-16 12:28:20.138: INFO/ActivityManager(67): Force stopping package com.example.userpage uid=10036
02-16 12:28:20.368: DEBUG/dalvikvm(129): GC_EXPLICIT freed 892 objects / 48744 bytes in 175ms
02-16 12:28:21.317: WARN/RecognitionManagerService(67): no available voice recognition services found
02-16 12:28:22.827: DEBUG/dalvikvm(67): GC_EXPLICIT freed 3877 objects / 241128 bytes in 452ms
02-16 12:28:22.979: INFO/installd(35): unlink /data/dalvik-cache/data@
[email protected]@classes.dex
02-16 12:28:23.277: DEBUG/AndroidRuntime(1019): Shutting down VM
02-16 12:28:23.307: DEBUG/dalvikvm(1019): Debugger has detached; object registry had 1 entries
02-16 12:28:23.328: INFO/AndroidRuntime(1019): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:28:24.989: DEBUG/AndroidRuntime(1032): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
02-16 12:28:24.989: DEBUG/AndroidRuntime(1032): CheckJNI is ON
02-16 12:28:25.888: DEBUG/AndroidRuntime(1032): --- registering native functions ---
02-16 12:28:28.588: INFO/ActivityManager(67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.userpage/.UserPage }
02-16 12:28:28.888: DEBUG/AndroidRuntime(1032): Shutting down VM
02-16 12:28:28.997: DEBUG/dalvikvm(1032): Debugger has detached; object registry had 1 entries
02-16 12:28:29.038: INFO/AndroidRuntime(1032): NOTE: attach of thread 'Binder Thread #3' failed
02-16 12:28:30.417: INFO/ActivityManager(67): Start proc com.example.userpage for activity com.example.userpage/.UserPage: pid=1039 uid=10036 gids={}
02-16 12:28:32.588: DEBUG/AndroidRuntime(1039): Shutting down VM
02-16 12:28:32.598: WARN/dalvikvm(1039): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): FATAL EXCEPTION: main
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.userpage/com.example.userpage.UserPage}: java.lang.ClassCastException: android.widget.TextView
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.
os.Handler.dispatchMessage(Handler.java:99)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.
os.Looper.loop(Looper.java:123)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at java.lang.reflect.Method.invokeNative(Native Method)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at java.lang.reflect.Method.invoke(Method.java:521)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at com.android.internal.
os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at com.android.internal.
os.ZygoteInit.main(ZygoteInit.java:626)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at dalvik.system.NativeStart.main(Native Method)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): Caused by: java.lang.ClassCastException: android.widget.TextView
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at com.example.userpage.UserPage.onCreate(UserPage.java:34)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-16 12:28:32.648: ERROR/AndroidRuntime(1039): ... 11 more
02-16 12:28:32.698: WARN/ActivityManager(67): Force finishing activity com.example.userpage/.UserPage
02-16 12:28:32.967: DEBUG/dalvikvm(292): GC_EXPLICIT freed 46 objects / 2240 bytes in 6840ms
02-16 12:28:33.247: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{43ee7b70 com.example.userpage/.UserPage}
02-16 12:28:36.947: INFO/Process(1039): Sending signal. PID: 1039 SIG: 9
02-16 12:28:37.017: INFO/ActivityManager(67): Process com.example.userpage (pid 1039) has died.
02-16 12:28:37.128: WARN/InputManagerService(67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e872f8
02-16 12:28:42.087: DEBUG/dalvikvm(176): GC_EXPLICIT freed 156 objects / 11488 bytes in 145ms
02-16 12:28:45.391: WARN/ActivityManager(67): Activity destroy timeout for HistoryRecord{43ee7b70 com.example.userpage/.UserPage}
02-16 12:28:47.177: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol