Hello all,
I am new to android. Am doing android application in windows XP usign
eclipse. I tried to do an android application which should display
appropriate shape by clicking on the appropriate buttons(buttons at
the bottom of the screen).
But I got 'Force close' message while running the application. And I
got some errors in LogCat. Don't know to solve it. So please help me
to get the exact output. My code follows
package hello.tab;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class HelloUIActivity extends Activity {
/** Called when the activity is first created. */
private Button sSquare,sCircle;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);//frame
sSquare=(Button)this.findViewById(R.id.getSquare);
sCircle=(Button)this.findViewById(R.id.getCircle);
sSquare.setOnClickListener(new View.OnClickListener() {
//@Override
public void onClick(View v)
{
ImageView imageView = (ImageView)
findViewById(R.id.getSquare);
imageView.setImageResource(R.drawable.icon);
//TODO Auto-generated method stub
}
});
sCircle.setOnClickListener(new View.OnClickListener()
{
//@Override
public void onClick(View v)
{
ImageView
i=(ImageView)findViewById(R.id.getCircle);
i.setImageResource(R.drawable.circle);
// TODO Auto-generated method stub
}
});
}
{
try{
throw new Exception();
}
catch(Exception e)
{
Log.e("DEBUGTAG","error occured",e);
Log.i("UserInterface","UILogCat",e);
}
}
}
The errors in LogCat are
08-05 12:13:51.875: INFO/Process(195): Sending signal. PID: 195 SIG: 9
08-05 12:13:51.902: INFO/ActivityManager(60): Process hello.tab (pid
195) has died.
08-05 12:13:51.923: INFO/WindowManager(60): WIN DEATH: Window{44d967a0
hello.tab/hello.tab.HelloUIActivity paused=false}
08-05 12:13:51.953: INFO/UsageStats(60): Unexpected resume of
com.android.launcher while already resumed in hello.tab
08-05 12:13:52.113: WARN/InputManagerService(60): Got RemoteException
sending setActive(false) notification to pid 195 uid 10029
08-05 12:13:52.313: INFO/ActivityManager(60): Displayed activity
com.android.launcher/.Launcher: 57641 ms (total 57641 ms)
08-05 12:13:57.742: DEBUG/AndroidRuntime(227): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
08-05 12:13:57.742: DEBUG/AndroidRuntime(227): CheckJNI is ON
08-05 12:13:57.992: DEBUG/AndroidRuntime(227): --- registering native
functions ---
08-05 12:13:58.383: DEBUG/ddm-heap(227): Got feature list request
08-05 12:13:58.813: DEBUG/PackageParser(60): Scanning package: /data/
app/vmdl33974.tmp
08-05 12:13:58.943: INFO/PackageManager(60): Removing non-system
package:hello.tab
08-05 12:13:58.943: DEBUG/PackageManager(60): Removing package
hello.tab
08-05 12:13:58.943: DEBUG/PackageManager(60): Activities:
hello.tab.HelloUIActivity
08-05 12:13:59.053: DEBUG/PackageManager(60): Scanning package
hello.tab
08-05 12:13:59.053: INFO/PackageManager(60): /data/app/vmdl33974.tmp
changed; unpacking
08-05 12:13:59.064: DEBUG/installd(31): DexInv: --- BEGIN '/data/app/
vmdl33974.tmp' ---
08-05 12:13:59.263: DEBUG/dalvikvm(233): DexOpt: load 39ms, verify
53ms, opt 3ms
08-05 12:13:59.283: DEBUG/installd(31): DexInv: --- END '/data/app/
vmdl33974.tmp' (success) ---
08-05 12:13:59.283: DEBUG/PackageManager(60): Activities:
hello.tab.HelloUIActivity
08-05 12:13:59.303: DEBUG/ActivityManager(60): Uninstalling process
hello.tab
08-05 12:13:59.393: INFO/installd(31): move /data/dalvik-cache/
data@[email protected]@classes.dex -> /data/dalvik-cache/
data@[email protected]@classes.dex
08-05 12:13:59.403: DEBUG/PackageManager(60): New package installed
in /data/app/hello.tab.apk
08-05 12:13:59.533: DEBUG/AndroidRuntime(227): Shutting down VM
08-05 12:13:59.533: DEBUG/dalvikvm(227): DestroyJavaVM waiting for non-
daemon threads to exit
08-05 12:13:59.544: DEBUG/dalvikvm(227): DestroyJavaVM shutting VM
down
08-05 12:13:59.544: DEBUG/dalvikvm(227): HeapWorker thread shutting
down
08-05 12:13:59.544: DEBUG/dalvikvm(227): HeapWorker thread has shut
down
08-05 12:13:59.544: DEBUG/jdwp(227): JDWP shutting down net...
08-05 12:13:59.544: INFO/dalvikvm(227): Debugger has detached; object
registry had 1 entries
08-05 12:13:59.553: DEBUG/dalvikvm(227): VM cleaning up
08-05 12:13:59.583: DEBUG/dalvikvm(227): LinearAlloc 0x0 used 623916
of 5242880 (11%)
08-05 12:13:59.583: ERROR/AndroidRuntime(227): ERROR: thread attach
failed
08-05 12:13:59.613: DEBUG/ActivityManager(60): Uninstalling process
hello.tab
08-05 12:13:59.803: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f0700e5
08-05 12:13:59.844: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f020031
08-05 12:13:59.844: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f020030
08-05 12:13:59.844: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f050000
08-05 12:13:59.863: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f060000
08-05 12:13:59.903: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f060001
08-05 12:14:00.153: DEBUG/dalvikvm(106): GC freed 1321 objects / 64904
bytes in 337ms
08-05 12:14:00.404: DEBUG/dalvikvm(60): GC freed 9465 objects / 572584
bytes in 323ms
08-05 12:14:00.793: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f0700e5
08-05 12:14:00.793: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f020031
08-05 12:14:00.793: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f020030
08-05 12:14:00.793: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f050000
08-05 12:14:00.813: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f060000
08-05 12:14:00.903: WARN/ResourceType(60): Resources don't contain
package for resource number 0x7f060001
08-05 12:14:01.213: DEBUG/AndroidRuntime(238): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
08-05 12:14:01.244: DEBUG/AndroidRuntime(238): CheckJNI is ON
08-05 12:14:01.734: DEBUG/AndroidRuntime(238): --- registering native
functions ---
08-05 12:14:02.133: DEBUG/ddm-heap(238): Got feature list request
08-05 12:14:02.563: INFO/ActivityManager(60): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10000000
cmp=hello.tab/.HelloUIActivity }
08-05 12:14:02.603: INFO/ActivityManager(60): Start proc hello.tab for
activity hello.tab/.HelloUIActivity: pid=245 uid=10029 gids={}
08-05 12:14:02.623: DEBUG/AndroidRuntime(238): Shutting down VM
08-05 12:14:02.623: DEBUG/dalvikvm(238): DestroyJavaVM waiting for non-
daemon threads to exit
08-05 12:14:02.623: DEBUG/dalvikvm(238): DestroyJavaVM shutting VM
down
08-05 12:14:02.623: DEBUG/dalvikvm(238): HeapWorker thread shutting
down
08-05 12:14:02.633: DEBUG/dalvikvm(238): HeapWorker thread has shut
down
08-05 12:14:02.633: DEBUG/jdwp(238): JDWP shutting down net...
08-05 12:14:02.633: INFO/dalvikvm(238): Debugger has detached; object
registry had 1 entries
08-05 12:14:02.644: DEBUG/dalvikvm(238): VM cleaning up
08-05 12:14:02.693: ERROR/AndroidRuntime(238): ERROR: thread attach
failed
08-05 12:14:02.715: DEBUG/dalvikvm(238): LinearAlloc 0x0 used 639500
of 5242880 (12%)
08-05 12:14:02.883: DEBUG/ddm-heap(245): Got feature list request
08-05 12:14:03.003: INFO/ARMAssembler(60): generated
scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at
[0x4465f8:0x446774] in 762195 ns
08-05 12:14:03.123: INFO/ARMAssembler(60): generated
scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at
[0x446778:0x446884] in 533235 ns
08-05 12:14:03.332: ERROR/DEBUGTAG(245): error occured
08-05 12:14:03.332: ERROR/DEBUGTAG(245): java.lang.Exception
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
hello.tab.HelloUIActivity.<init>(HelloUIActivity.java:59)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
java.lang.Class.newInstanceImpl(Native Method)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
java.lang.Class.newInstance(Class.java:1479)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2409)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.os.Looper.loop(Looper.java:123)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
android.app.ActivityThread.main(ActivityThread.java:4363)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
java.lang.reflect.Method.invokeNative(Native Method)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
java.lang.reflect.Method.invoke(Method.java:521)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-05 12:14:03.332: ERROR/DEBUGTAG(245): at
dalvik.system.NativeStart.main(Native Method)
08-05 12:14:03.373: INFO/UserInterface(245): UILogCat
08-05 12:14:03.373: INFO/UserInterface(245): java.lang.Exception
08-05 12:14:03.373: INFO/UserInterface(245): at
hello.tab.HelloUIActivity.<init>(HelloUIActivity.java:59)
08-05 12:14:03.373: INFO/UserInterface(245): at
java.lang.Class.newInstanceImpl(Native Method)
08-05 12:14:03.373: INFO/UserInterface(245): at
java.lang.Class.newInstance(Class.java:1479)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2409)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.os.Looper.loop(Looper.java:123)
08-05 12:14:03.373: INFO/UserInterface(245): at
android.app.ActivityThread.main(ActivityThread.java:4363)
08-05 12:14:03.373: INFO/UserInterface(245): at
java.lang.reflect.Method.invokeNative(Native Method)
08-05 12:14:03.373: INFO/UserInterface(245): at
java.lang.reflect.Method.invoke(Method.java:521)
08-05 12:14:03.373: INFO/UserInterface(245): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-05 12:14:03.373: INFO/UserInterface(245): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-05 12:14:03.373: INFO/UserInterface(245): at
dalvik.system.NativeStart.main(Native Method)
08-05 12:14:03.633: INFO/ActivityManager(60): Displayed activity
hello.tab/.HelloUIActivity: 1042 ms (total 1042 ms)
08-05 12:14:08.823: DEBUG/dalvikvm(106): GC freed 2432 objects /
139624 bytes in 157ms
08-05 12:15:38.933: DEBUG/AndroidRuntime(245): Shutting down VM
08-05 12:15:38.933: WARN/dalvikvm(245): threadid=3: thread exiting
with uncaught exception (group=0x4001b188)
08-05 12:15:38.933: ERROR/AndroidRuntime(245): Uncaught handler:
thread main exiting due to uncaught exception
08-05 12:15:38.953: ERROR/AndroidRuntime(245):
java.lang.ClassCastException: android.widget.Button
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
hello.tab.HelloUIActivity$1.onClick(HelloUIActivity.java:35)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.View.performClick(View.java:2364)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.View.onTouchEvent(View.java:4179)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.widget.TextView.onTouchEvent(TextView.java:6541)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.View.dispatchTouchEvent(View.java:3709)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.os.Looper.loop(Looper.java:123)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
android.app.ActivityThread.main(ActivityThread.java:4363)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
java.lang.reflect.Method.invokeNative(Native Method)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
java.lang.reflect.Method.invoke(Method.java:521)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-05 12:15:38.953: ERROR/AndroidRuntime(245): at
dalvik.system.NativeStart.main(Native Method)
08-05 12:15:38.963: INFO/Process(60): Sending signal. PID: 245 SIG: 3
08-05 12:15:38.973: INFO/dalvikvm(245): threadid=7: reacting to signal
3
08-05 12:15:39.043: INFO/dalvikvm(245): Wrote stack trace to '/data/
anr/traces.txt'
08-05 12:20:39.041: INFO/Process(245): Sending signal. PID: 245 SIG: 9
08-05 12:20:39.073: ERROR/JavaBinder(60): !!! FAILED BINDER
TRANSACTION !!!
08-05 12:20:39.073: INFO/ActivityManager(60): Process hello.tab (pid
245) has died.
08-05 12:20:39.093: INFO/WindowManager(60): WIN DEATH: Window{44d5b8f8
hello.tab/hello.tab.HelloUIActivity paused=false}
08-05 12:20:39.223: INFO/UsageStats(60): Unexpected resume of
com.android.launcher while already resumed in hello.tab
08-05 12:20:39.453: WARN/InputManagerService(60): Got RemoteException
sending setActive(false) notification to pid 245 uid 10029
Thanks and Regards,
Divya
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en