model : zt180
firmware : android 2.1-update1-20101030
kernel : 2.6.32.9 usbandroid #1608
build number zt180-eng 2.1-update1 20101030
google maps : 4.5.1
Various crashes occur when embedding the google maps component into an android application. I'm connecting to a router via Wi-Fi for internet access. The stand-alone google maps app seems to work fine. To re-produce, start the maps app and begin scrolling around.
Will fail within a couple of minutes, occasionally on start-up (in setContentView). Most of the errors are when drawing tiles in google code. Sometimes just an Android SEGV.
NOTE : I've tested the same app on the Android developer phone 2 (os 1.6), and it works fine.
My android app is as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="043yBg1m9IiFNKXIhN5LsdeNndw2k7yrw4Ja3xQ"/>
</RelativeLayout>
import com.google.android.maps.MapActivity;
import android.os.Bundle;
public class Maps extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
protected boolean isRouteDisplayed() { return false; }
}
=========================
W/MapActivity( 2745): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher#45ebcd30
V/MapActivity( 2745): Recycling map object.
I/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 720 ms (total 720 ms)
I/MapActivity( 2745): Handling network change notification:CONNECTED
E/MapActivity( 2745): Couldn't get connection factory client
D/AndroidRuntime( 2745): Shutting down VM
W/dalvikvm( 2745): threadid=3: thread exiting with uncaught exception (group=0x4001b168)
E/AndroidRuntime( 2745): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 2745): java.lang.IncompatibleClassChangeError: interface not implemented
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.checkPaintTimeExceeded(Unknown Source)
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
E/AndroidRuntime( 2745): at com.google.googlenav.map.Map.drawMap(Unknown Source)
E/AndroidRuntime( 2745): at com.google.android.maps.MapView.drawMap(MapView.java:1048)
E/AndroidRuntime( 2745): at com.google.android.maps.MapView.onDraw(MapView.java:486)
<snip>
I/Process ( 2745): Sending signal. PID: 2745 SIG: 9
I/ActivityManager( 2010): Process com.brta.android.lite (pid 2745) has died.
I/WindowManager( 2010): WIN DEATH: Window{46112878 com.brta.android.lite/com.brta.android.lite.Maps paused=false}
I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite`
======================================================================
I/MapActivity( 2863): Handling network change notification:CONNECTED
E/MapActivity( 2863): Couldn't get connection factory client
D/dalvikvm( 2863): GC freed 8114 objects / 577376 bytes in 86ms
D/dalvikvm( 2863): GC freed 685 objects / 444384 bytes in 85ms
D/dalvikvm( 2863): GC freed 3458 objects / 259456 bytes in 79ms
I/ActivityManager( 2010): Displayed activity com.brta.android.lite/.Maps: 4407 ms (total 4407 ms)
D/AndroidRuntime( 2863): Shutting down VM
W/dalvikvm( 2863): threadid=3: thread exiting with uncaught exception (group=0x4001b168)
E/AndroidRuntime( 2863): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 2863): java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
E/AndroidRuntime( 2863): at java.util.Vector.elementAt(Vector.java:331)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawTile(Unknown Source)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
E/AndroidRuntime( 2863): at com.google.googlenav.map.Map.drawMap(Unknown Source)
E/AndroidRuntime( 2863): at com.google.android.maps.MapView.drawMap(MapView.java:1048)
E/AndroidRuntime( 2863): at com.google.android.maps.MapView.onDraw(MapView.java:486)
E/AndroidRuntime( 2863): at android.view.View.draw(View.java:6535)
E/AndroidRuntime( 2863): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
E/AndroidRuntime( 2863): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
<snip>
E/AndroidRuntime( 2863): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 2010): Sending signal. PID: 2863 SIG: 3
I/dalvikvm( 2863): threadid=7: reacting to signal 3
I/dalvikvm( 2863): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2863): Sending signal. PID: 2863 SIG: 9
I/WindowManager( 2010): WIN DEATH: Window{460ac708 com.brta.android.lite/com.brta.android.lite.Maps paused=false}
I/ActivityManager( 2010): Process com.brta.android.lite (pid 2863) has died.
I/UsageStats( 2010): Unexpected resume of org.adw.launcher while already resumed in com.brta.android.lite
W/InputManagerService( 2010): Got RemoteException sending setActive(false) notification to pid 2863 uid 10046
Basically, lots of bad things start happening...
The ZT-180 does not have Google Maps, AFAIK.
Related
I have a activity which uses a listview element as follows
public class List1 extends Activity
{
Context context=this;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
try{
//DB
final SQLiteDatabase db;
db = openOrCreateDatabase(
"Secret.db"
, SQLiteDatabase.CREATE_IF_NECESSARY
, null
);
db.setVersion(1);
db.setLocale(Locale.getDefault());
db.setLockingEnabled(true);
Cursor cur = db.query("tbl_user",null,null,null,null,null,null);
//DB Over
ListView listView = (ListView) findViewById(R.id.mylist);
listView.setTextFilterEnabled(true);
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item,values);
listView.setAdapter(adapter);
listView.setVisibility(0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position,long id)
//public void onItemClick(ListView<?> listview, View view, int position,long id)
{
try
{
Intent i=new Intent(List1.this,Form1.class);
i.putExtra("uid","85");
startActivity(i);
finish();
}
catch(Exception e)
{
String insert2="insert into login values("+"\""+e.toString()+"\""+");";
db.execSQL(insert2);
}
}
});
db.close();
//required
}
catch(Exception e)
{
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show();}
}
}
This is my listview.xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</RelativeLayout>
This is my list_item.xml file which has the required textview
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/tv1"
android:padding="10dp"
android:background="#drawable/textview1"
style="#style/textview_text"
android:textSize="16dp">
</TextView>
But the ListView is not working. I mean after coming to this activity the app is showing error showing "APP_NAME is stopped unexpectedly". The same code works for one or two times and then shows the above error continuously after that. May I kno why is it happening?
EDIT
This is logcat file
W/dalvikvm( 2694): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2694): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2694): java.lang.NullPointerException
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2694): at android.widget.AbsListView.obtainView(AbsList
View.java:1274)
E/AndroidRuntime( 2694): at android.widget.ListView.makeAndAddView(ListVi
ew.java:1668)
E/AndroidRuntime( 2694): at android.widget.ListView.fillDown(ListView.jav
a:637)
E/AndroidRuntime( 2694): at android.widget.ListView.fillFromTop(ListView.
java:694)
E/AndroidRuntime( 2694): at android.widget.ListView.layoutChildren(ListVi
ew.java:1521)
E/AndroidRuntime( 2694): at android.widget.AbsListView.onLayout(AbsListVi
ew.java:1113)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.RelativeLayout.onLayout(Relati
veLayout.java:900)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.setChildFrame(Lin
earLayout.java:1119)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.layoutVertical(Li
nearLayout.java:998)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.onLayout(LinearLa
yout.java:918)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.view.ViewRoot.performTraversals(ViewR
oot.java:996)
E/AndroidRuntime( 2694): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2694): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2694): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2694): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2694): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 2694): GC freed 6621 objects / 343272 bytes in 126ms
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c60cd0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c58028 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c37fa0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/Process ( 52): Sending signal. PID: 2694 SIG: 3
I/dalvikvm( 2694): threadid=7: reacting to signal 3
I/dalvikvm( 2694): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2694): Sending signal. PID: 2694 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2694) has died.
I/WindowManager( 52): WIN DEATH: Window{44d90538 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44d933c8
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2706 uid=10034 gids={3003}
D/ddm-heap( 2706): Got feature list request
D/dalvikvm( 1152): GC freed 194 objects / 8728 bytes in 88ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 262 m
s (total 8081 ms)
D/dalvikvm( 234): GC freed 44 objects / 2064 bytes in 134ms
D/AndroidRuntime( 2718):
D/AndroidRuntime( 2718): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2718): CheckJNI is ON
D/AndroidRuntime( 2718): --- registering native functions ---
D/ddm-heap( 2718): Got feature list request
D/PackageParser( 52): Scanning package: /data/app/vmdl67950.tmp
I/PackageManager( 52): Removing non-system package:com.notification
D/PackageManager( 52): Removing package com.notification
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44eb1868
D/PackageManager( 52): Scanning package com.notification
I/PackageManager( 52): /data/app/vmdl67950.tmp changed; unpacking
D/installd( 32): DexInv: --- BEGIN '/data/app/vmdl67950.tmp' ---
D/dalvikvm( 2724): DexOpt: load 40ms, verify 159ms, opt 2ms
D/installd( 32): DexInv: --- END '/data/app/vmdl67950.tmp' (success) ---
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
D/ActivityManager( 52): Uninstalling process com.notification
D/ActivityManager( 52): Force removing process ProcessRecord{44e9eb48 2706:com
.notification/10034} (com.notification/10034)
I/Process ( 52): Sending signal. PID: 2706 SIG: 9
D/ActivityManager( 52): Received spurious death notification for thread androi
d.os.BinderProxy#44eec8b8
I/installd( 32): move /data/dalvik-cache/data#app#vmdl67950.tmp#classes.dex ->
/data/dalvik-cache/data#app#com.notification.apk#classes.dex
D/PackageManager( 52): New package installed in /data/app/com.notification.apk
D/AndroidRuntime( 2718): Shutting down VM
D/dalvikvm( 2718): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2718): DestroyJavaVM shutting VM down
D/dalvikvm( 2718): HeapWorker thread shutting down
D/dalvikvm( 2718): HeapWorker thread has shut down
D/jdwp ( 2718): JDWP shutting down net...
I/dalvikvm( 2718): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2718): VM cleaning up
D/dalvikvm( 2718): LinearAlloc 0x0 used 623916 of 5242880 (11%)
D/ActivityManager( 52): Uninstalling process com.notification
I/dalvikvm( 2718): JNI: AttachCurrentThread (from ???.???)
E/AndroidRuntime( 2718): ERROR: thread attach failed
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/dalvikvm( 1152): GC freed 139 objects / 5928 bytes in 230ms
D/dalvikvm( 52): GC freed 14606 objects / 863536 bytes in 259ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
D/dalvikvm( 52): GC freed 425 objects / 17320 bytes in 275ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/AndroidRuntime( 2729):
D/AndroidRuntime( 2729): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2729): CheckJNI is ON
D/AndroidRuntime( 2729): --- registering native functions ---
D/ddm-heap( 2729): Got feature list request
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Start proc com.notification for activity com.notificat
ion/.NotificationActivity: pid=2735 uid=10034 gids={3003}
D/AndroidRuntime( 2729): Shutting down VM
D/dalvikvm( 2729): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2729): DestroyJavaVM shutting VM down
D/dalvikvm( 2729): HeapWorker thread shutting down
D/dalvikvm( 2729): HeapWorker thread has shut down
D/jdwp ( 2729): JDWP shutting down net...
I/dalvikvm( 2729): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2729): VM cleaning up
E/AndroidRuntime( 2729): ERROR: thread attach failed
D/dalvikvm( 2729): LinearAlloc 0x0 used 639500 of 5242880 (12%)
D/dalvikvm( 30): GC freed 299 objects / 11576 bytes in 264ms
D/ddm-heap( 2735): Got feature list request
D/dalvikvm( 30): GC freed 57 objects / 2432 bytes in 160ms
D/dalvikvm( 30): GC freed 2 objects / 48 bytes in 360ms
I/ActivityManager( 52): Displayed activity com.notification/.NotificationActiv
ity: 1204 ms (total 1204 ms)
W/KeyCharacterMap( 2735): No keyboard for id 0
W/KeyCharacterMap( 2735): Using default keymap: /system/usr/keychars/qwerty.kcm.
bin
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Bg (
has extras) }
I/ActivityManager( 52): Displayed activity com.notification/.Bg: 329 ms (total
329 ms)
D/dalvikvm( 1152): GC freed 2454 objects / 141000 bytes in 600ms
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.List
1 bnds=[0,152][480,248] }
W/ActivityManager( 52): startActivity called from non-Activity context; forcin
g Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.notification/.List1 bnds=[
0,152][480,248] }
D/AndroidRuntime( 2735): Shutting down VM
W/dalvikvm( 2735): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2735): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2735): java.lang.NullPointerException
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2735): at android.widget.AbsListView.obtainView(AbsList
View.java:1256)
E/AndroidRuntime( 2735): at android.widget.ListView.measureHeightOfChildr
en(ListView.java:1147)
E/AndroidRuntime( 2735): at android.widget.ListView.onMeasure(ListView.ja
va:1060)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.measureChild(Re
lativeLayout.java:554)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.onMeasure(Relat
iveLayout.java:377)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.measureVertical(L
inearLayout.java:464)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.onMeasure(LinearL
ayout.java:278)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewRoot.performTraversals(ViewR
oot.java:763)
E/AndroidRuntime( 2735): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2735): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2735): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2735): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2735): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 52): Sending signal. PID: 2735 SIG: 3
I/dalvikvm( 2735): threadid=7: reacting to signal 3
I/dalvikvm( 2735): Wrote stack trace to '/data/anr/traces.txt'
W/ActivityManager( 52): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 52): Activity idle timeout for HistoryRecord{44dcace0 com.n
otification/.List1}
I/Process ( 2735): Sending signal. PID: 2735 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2735) has died.
I/WindowManager( 52): WIN DEATH: Window{44d8db78 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2745 uid=10034 gids={3003}
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44f2e3d8
E/gralloc ( 52): [unregister] handle 0x423290 still locked (state=40000001)
D/ddm-heap( 2745): Got feature list request
D/dalvikvm( 1152): GC freed 212 objects / 9560 bytes in 82ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 240 m
s (total 16387 ms)
D/dalvikvm( 234): GC freed 43 objects / 2024 bytes in 152ms
i think your adapter should know which textViewResourceId it should use.
So try this out: ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item, R.id.tv1,values);
Change this to
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
this
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
And why do you need listView.setVisibility(0)?
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
Starting from the this spinet of code.
When the db.query returns you should rewind the cursor before starting to use it in the while loop. What if the query returns more the 50 results? Your app will crash with ArrayOutBoundException
I am just trying out the "TouchPaint" sample provided by Google Android examples at:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html
Created my own AndroidManifest.xml, and I figured that "GraphicsActivity.java" and "PictureLayout.java" are two other java files before I could compiled and create the apk successfully.
After I load into my Android phone, it displayed a blank screen. At this point nothing happened yet, but once I touch the screen, the apps died, and generated the following trace in logcat output:
D/dalvikvm( 4939): GC_CONCURRENT freed 44K, 49% free 2779K/5379K, external 3286K/4104K, paused 4ms+2ms
D/dalvikvm( 365): GC_CONCURRENT freed 1102K, 54% free 3271K/7047K, external 2612K/3262K, paused 4ms+4ms
I/ActivityManager( 266): Displayed com.example.android.apis.graphics/.TouchPaint: +382ms
D/AndroidRuntime( 4939): Shutting down VM
W/dalvikvm( 4939): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
E/AndroidRuntime( 4939): FATAL EXCEPTION: main
E/AndroidRuntime( 4939): java.lang.NoSuchMethodError: android.view.MotionEvent.getButtonState
E/AndroidRuntime( 4939): at com.example.android.apis.graphics.TouchPaint$PaintView.onTouchOrHoverEvent(TouchPaint.java:346)
E/AndroidRuntime( 4939): at com.example.android.apis.graphics.TouchPaint$PaintView.onTouchEvent(TouchPaint.java:337)
E/AndroidRuntime( 4939): at android.view.View.dispatchTouchEvent(View.java:3952)
E/AndroidRuntime( 4939): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:961)
E/AndroidRuntime( 4939): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:961)
E/AndroidRuntime( 4939): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1711)
E/AndroidRuntime( 4939): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1145)
E/AndroidRuntime( 4939): at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
E/AndroidRuntime( 4939): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1695)
E/AndroidRuntime( 4939): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2217)
E/AndroidRuntime( 4939): at android.view.ViewRoot.handleMessage(ViewRoot.java:1901)
E/AndroidRuntime( 4939): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4939): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 4939): at android.app.ActivityThread.main(ActivityThread.java:3701)
E/AndroidRuntime( 4939): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4939): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 4939): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/AndroidRuntime( 4939): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
E/AndroidRuntime( 4939): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 266): Force finishing activity com.example.android.apis.graphics/.TouchPaint
W/ActivityManager( 266): Activity pause timeout for HistoryRecord{2afed900 com.example.android.apis.graphics/.TouchPaint}
I/InputDispatcher( 266): Application is not responding: Window{2b3f4d00 com.example.android.apis.graphics/com.example.android.apis.graphics.TouchPaint paused=false}. 5002.0ms since event, 5001.8ms since wait started
I/InputDispatcher( 266): Dropping event because the pointer is not down.
I/WindowManager( 266): Input event dispatching timed out sending to com.example.android.apis.graphics/com.example.android.apis.graphics.TouchPaint
W/ActivityManager( 266): Activity destroy timeout for HistoryRecord{2afed900 com.example.android.apis.graphics/.TouchPaint}
D/lights ( 266): set_light_backlight: brightness=20
I/ActivityManager( 266): No longer want com.facebook.katana (pid 4319): hidden #16
W/ActivityManager( 266): Scheduling restart of crashed service com.facebook.katana/.service.UploadManager in 5000ms
I am puzzled over what is the possible cause of crashing?
This method is only available since API Level 14, set minSdkVersion to 14 in the Manifest
public final int getButtonState ()
Since: API Level 14
Gets the state of all buttons that are pressed such as a mouse or stylus button.
Returns
The button state.
I found the answer:
http://developer.android.com/resources/dashboard/platform-versions.html
http://developer.android.com/guide/appendix/api-levels.html
From the web page's table, since I know my phone is using Android 2.3.4, so that max target API for SDK should be 10. So instead of using the TouchPaint.java sample from android-14, I copied the TouchPaint.java from android-10,change the minSDK version to 10 inside my AndroidManifest.xml file:
<uses-sdk android:minSdkVersion="10"/>
Everything works!! Thanks to Rajdeep Dua too!!!
I am having a weird problem.
I am developing a program to log GPS and sensor readings periodically. My friend runs the code on his machine using Eclipse Galileo 3.6 and it works perfectly fine for her.
When I run the code on my machine which has Eclipse Galileo 3.5.2 it shows service stopped unexpectedly.
We have the same JDK version. I am not able to figure out what may be the exact problem.
Please let me know what else information I need to give in order to fix the problem.
logcat
I/ActivityManager( 1104): Start proc com.sensor.test for service com.sensor.test/.SensorReadings: pid=3539 uid=10057 gids={3003, 1015}
D/AndroidRuntime( 3539): Shutting down VM
W/dalvikvm( 3539): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0)
E/AndroidRuntime( 3539): FATAL EXCEPTION: main
E/AndroidRuntime( 3539): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000000 (has extras) } in com.sensor.test.SensorReadings$2#44770958
E/AndroidRuntime( 3539): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:905)
E/AndroidRuntime( 3539): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 3539): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 3539): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3539): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 3539): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3539): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3539): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 3539): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 3539): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3539): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 3539): at com.sensor.test.SensorReadings$2.onReceive(SensorReadings.java:327)
E/AndroidRuntime( 3539): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)
E/AndroidRuntime( 3539): ... 9 more
W/ActivityManager( 1104): Activity destroy timeout for HistoryRecord{44b38508 com.sensor.test/.MainScreen}
D/WifiService( 1104): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder#44963d80}
D/LocationMasfClient( 1104): getNetworkLocation(): Location not found in cache, making network request
D/LocationMasfClient( 1104): getNetworkLocation(): Number of prefetched entries 10
E/LocationMasfClient( 1104): getNetworkLocation(): Returning *server* computed location with accuracy 28
D/libgps ( 1104): GpsInterface_inject_location( 35.772249, -78.673950, 28.000 )
D/WifiService( 1104): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder#44963d80}
D/WifiService( 1104): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder#44963d80}
D/WifiService( 1104): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder#44963d80}
D/NativeCrypto( 1104): Freeing OpenSSL session
D/dalvikvm( 1104): GC_FOR_MALLOC freed 22104 objects / 1169312 bytes in 128ms
D/NativeCrypto( 1104): Freeing OpenSSL session
I/Process ( 3539): Sending signal. PID: 3539 SIG: 9
W/InputManagerService( 1104): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#44b40dd0
I/ActivityManager( 1104): Process com.sensor.test (pid 3539) has died.
The pertinent code for line 88 with parsing going on:
public void startService(){
//startService(new Intent(MainScreen.this,SensorReadings.class));
Intent intent = new Intent(MainScreen.this, SensorReadings.class);
**intent.putExtra("lp", Integer.parseInt(""+longPeriod.getText()));// LINE 88**
intent.putExtra("gp", Integer.parseInt(""+gpsPeriod.getText()));
intent.putExtra("sp", Integer.parseInt(""+snrPeriod.getText()));
//startActivity(intent);
startService(intent);
}
Thanks.
AG
E/AndroidRuntime( 2934): java.lang.NumberFormatException: unable to parse '' as integer
E/AndroidRuntime( 2934): at java.lang.Integer.parseInt(Integer.java:412)
E/AndroidRuntime( 2934): at java.lang.Integer.parseInt(Integer.java:382)
E/AndroidRuntime( 2934): at com.sensor.test.MainScreen.startService(MainScreen.java:88)
Perhaps at line 88 in MainScreen.java, your startService method is calling Integer.parseInt with an empty string?
Can you show us the pertinent code?
I don't get why you are putting "".
So to be sure this is not the problem try either this:
intent.putExtra("lp", Integer.parseInt(longPeriod.getText()));
intent.putExtra("gp", Integer.parseInt(gpsPeriod.getText()));
intent.putExtra("sp", Integer.parseInt(snrPeriod.getText()));
or
String lp = longPeriod.getText();
String gp = gpsPeriod.getText();
String sp = snrPeriod.getText();
intent.putExtra("lp", Integer.parseInt(lp));
intent.putExtra("gp", Integer.parseInt(gp));
intent.putExtra("sp", Integer.parseInt(sp));
The second way is better for debugging... so you can see what is actually happening.
This is my first Android app and I've encountered an exception when trying to use the ListPreference. The application loads along with the preferences... but when i touch the ListPreference entry the applications "stops unexpectedly".
Settings.java
public class Settings extends PreferenceActivity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.addPreferencesFromResource(R.layout.settings);
}
}
settings.xml
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="chk_enabled"
android:summary="SMS response based on settings"
android:title="Enable"
/>
<ListPreference
android:title="Contacts"
android:summary="Contacs that will be sent SMSs"
android:key="list_contacts"
android:defaultValue="0"
android:entries="#array/list_entries"
android:entryValues="#array/list_values"
/>
</PreferenceScreen>
arrays.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="list_entries">
<item>All</item>
<item>WhiteList</item>
<item>BlackList</item>
</string-array>
<integer-array name="list_values">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
</resources>
This is the logcat output:
D/AndroidRuntime( 3187): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 3187): CheckJNI is OFF
D/AndroidRuntime( 3187): --- registering native functions ---
I/jdwp ( 3187): received file descriptor 16 from ADB
/ddm-heap( 3187): Got feature list request
I/ActivityManager( 86): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=tml.UI.main/.MainActivity }
D/AndroidRuntime( 3187): Shutting down VM
D/dalvikvm( 3187): DestroyJavaVM waiting for non-daemon threads to exit
I/ActivityManager( 86): Start proc tml.UI.main for activity tml.UI.main/.MainActivity: pid=3194 uid=10039 gids={1015}
D/dalvikvm( 3187): DestroyJavaVM shutting VM down
D/dalvikvm( 3187): HeapWorker thread shutting down
D/dalvikvm( 3187): HeapWorker thread has shut down
D/jdwp ( 3187): JDWP shutting down net...
D/jdwp ( 3187): +++ peer disconnected
I/dalvikvm( 3187): Debugger has detached; object registry had 1 entries
D/dalvikvm( 3187): VM cleaning up
D/dalvikvm( 3187): LinearAlloc 0x0 used 676380 of 4194304 (16%)
I/jdwp ( 3194): received file descriptor 10 from ADB
D/ddm-heap( 3194): Got feature list request
W/Resources( 3194): Converting to string: TypedValue{t=0x10/d=0x0 a=-1}
I/ActivityManager( 86): Displayed activity tml.UI.main/.MainActivity: 977 ms (total 977 ms)
D/AndroidRuntime( 3194): Shutting down VM
W/dalvikvm( 3194): threadid=3: thread exiting with uncaught exception (group=0x4001da28)
E/AndroidRuntime( 3194): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 3194): java.lang.NullPointerException
E/AndroidRuntime( 3194): at android.preference.ListPreference.findIndexOfValue(ListPreference.java:169)
E/AndroidRuntime( 3194): at android.preference.ListPreference.getValueIndex(ListPreference.java:178)
E/AndroidRuntime( 3194): at android.preference.ListPreference.onPrepareDialogBuilder(ListPreference.java:190)
E/AndroidRuntime( 3194): at android.preference.DialogPreference.showDialog(DialogPreference.java:291)
E/AndroidRuntime( 3194): at android.preference.DialogPreference.onClick(DialogPreference.java:262)
E/AndroidRuntime( 3194): at android.preference.Preference.performClick(Preference.java:811)
E/AndroidRuntime( 3194): at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)
E/AndroidRuntime( 3194): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime( 3194): at android.widget.ListView.performItemClick(ListView.java:3246)
E/AndroidRuntime( 3194): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1635)
E/AndroidRuntime( 3194): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 3194): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 3194): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3194): at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime( 3194): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3194): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3194): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 3194): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 3194): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 86): Sending signal. PID: 3194 SIG: 3
I/dalvikvm( 3194): threadid=7: reacting to signal 3
I/dalvikvm( 3194): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 3194): Sending signal. PID: 3194 SIG: 9
I/ActivityManager( 86): Process tml.UI.main (pid 3194) has died.
I/WindowManager( 86): WIN DEATH: Window{4341fd00 tml.UI.main/tml.UI.main.MainActivity paused=false}
W/UsageStats( 86): Unexpected resume of com.android.launcher while already resumed in tml.UI.main
W/InputManagerService( 86): Got RemoteException sending setActive(false) notification to pid 3194 uid 10039
I fixed it... I kept on trying and, at the end, it turns out that I cannot use an integer-array as the entryValues Source. I just changed that integer-array to a string-array and got it working.
If there's a way to use integer-array as the source for entryValues please comment.
I've been searching for a similar solution to what you are looking for, agreeing that you should be able to use an Integer array to read from and store an integer result.
A solution to this problem I found was at http://kvance.livejournal.com/1039349.html, which I found to be useful.
It doesn't quite solve the problem the way I was thinking or that way I think you want it to, instead you still specify your initial / selection values with a String array although when the ListPreference saves it back to the SharedPreferences it saves as an Integer instead of a String (doing the conversion when the user selects it), removing the need to have to convert it possibly many times throughout your application when accessing the preference value.
I am new to android. I would like to ask you some question.
When I calling new activity from main activity by commands
Intent myIntent = new Intent(v.getContext(), PolarView.class);
//startActivityForResult(myIntent, 0);
startActivityForResult(myIntent, 0);
finish();
then in new activity I can't do any actions, e.g. such as button click
Both
Button btnSeven = (Button) this.findViewById(R.id.btn7);
btnSeven.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
InputStr = InputStr + "7";
InputViewField.setText(InputStr);
}
});
}
and
public void btn7_click(View v) {
InputStr = InputStr + "7";
InputViewField.setText(InputStr);
}
having defined android:onClick="btn7_click" in activity`s layout
where InputViewField is EditText object
In the first case new activity does not start, in the second case when I press this button, aplication crashes.
could you please help me?
Here is some last peace of logcat after change
StartActivityForResult()
to
StartActivity()
Logcat:
D/MediaScanner( 153): opendir /system/media/ failed, errno: 2
D/MediaScanner( 153): prescan time: 25225ms
D/MediaScanner( 153): scan time: 162ms
D/MediaScanner( 153): postscan time: 48ms
D/dalvikvm( 109): GC freed 1920 objects / 95640 bytes in 160ms
D/MediaScanner( 153): total time: 25435ms
D/MediaScannerService( 153): done scanning volume internal
D/MediaScannerService( 153): start scanning volume external
D/dalvikvm( 52): GREF has increased to 301
I/ActivityManager( 52): Starting activity: Intent { cmp=complex.ComplexCalc/.PolarView }
I/ActivityManager( 52): Displayed activity complex.ComplexCalc/.PolarView: 1414 ms (total 1414 ms)
V/MediaScanner( 153): pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor#43bc30b8
V/MediaScanner( 153): /pruneDeadThumbnailFiles... android.database.sqlite.SQLiteCursor#43bc30b8
D/MediaScanner( 153): prescan time: 1509ms
D/MediaScanner( 153): scan time: 405ms
D/MediaScanner( 153): postscan time: 323ms
D/MediaScanner( 153): total time: 2237ms
D/MediaScannerService( 153): done scanning volume external
D/AndroidRuntime( 223): Shutting down VM
W/dalvikvm( 223): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
E/AndroidRuntime( 223): Uncaught handler: thread main exiting due to uncaught exception
D/dalvikvm( 223): GC freed 3456 objects / 221888 bytes in 153ms
E/AndroidRuntime( 223): java.lang.IllegalStateException: Could not execute method of the activity
E/AndroidRuntime( 223): at android.view.View$1.onClick(View.java:2031)
E/AndroidRuntime( 223): at android.view.View.performClick(View.java:2364)
E/AndroidRuntime( 223): at android.view.View.onTouchEvent(View.java:4179)
E/AndroidRuntime( 223): at android.widget.TextView.onTouchEvent(TextView.java:6541)
E/AndroidRuntime( 223): at android.view.View.dispatchTouchEvent(View.java:3709)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 223): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
E/AndroidRuntime( 223): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
E/AndroidRuntime( 223): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
E/AndroidRuntime( 223): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
E/AndroidRuntime( 223): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
E/AndroidRuntime( 223): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 223): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 223): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 223): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 223): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 223): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 223): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 223): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 223): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 223): at complex.ComplexCalc.PolarView.btn7_click(PolarView.java:266)
E/AndroidRuntime( 223): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 223): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 223): at android.view.View$1.onClick(View.java:2026)
E/AndroidRuntime( 223): ... 23 more
E/AndroidRuntime( 223): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 223): ... 27 more
I/Process ( 52): Sending signal. PID: 223 SIG: 3
I/dalvikvm( 223): threadid=7: reacting to signal 3
I/dalvikvm( 223): Wrote stack trace to '/data/anr/traces.txt'
I/ARMAssembler( 52): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x46eae8:0x46eba4] in 1562593 ns
I/ARMAssembler( 52): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x46eba8:0x46ed70] in 1903198 ns
I/Process ( 223): Sending signal. PID: 223 SIG: 9
I/ActivityManager( 52): Process complex.ComplexCalc (pid 223) has died.
I/WindowManager( 52): WIN DEATH: Window{43cc3920 complex.ComplexCalc/complex.ComplexCalc.PolarView paused=false}
E/gralloc ( 52): [unregister] handle 0x481778 still locked (state=40000001)
I/UsageStats( 52): Unexpected resume of com.android.launcher while already resumed in complex.ComplexCalc
W/InputManagerService( 52): Got RemoteException sending setActive(false) notification to pid 223 uid 10024
I think part of your problem is that you are using startActivityForResult(..), when in fact you should be using startActivity(..), because your new activity might not be returning anything.
However, without error logs its difficult to tell what is really happening