I am trying to get nested viewflippers set up with the following setup
Top_ViewFlipper
- Type 1
Sub_ViewFlipper
- SubType 1
- SubType 2
- SubType 3
- Type 2
Sub_ViewFlipper
- SubType 1
- SubType 2
- SubType 3
Source can be found here: https://github.com/platinummonkey/TXLF-App/tree/master/android
The following links contain all the XML and source relevant to this problem (instead of viewing a wall of text):
sessions.xml (main xml)
session_day0.xml
session_day1.xml
session_track.xml
session_two_line_list.xml
Sessions.java
SessionListAdapter.java
Trace of Current Error:
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
D/KeyguardViewMediator( 981): wakeWhenReadyLocked(26)
I/power ( 981): *** set_screen_state 1
V/$$$$$$ ( 8060): In Method: ACTION_SCREEN_ON
V/$$$$$$ ( 8060): In service onStart: REGISTERED RECEIVER
D/SurfaceFlinger( 981): Screen about to return, flinger = 0x95b38
V/$$$$$$ ( 8060): In Method: ACTION_USER_PRESENT
I/ActivityManager( 981): Start proc com.android.settings for broadcast com.android.settings/.widget.SettingsAppWidgetProvider: pid=8945 uid=1000 gids={1015, 3002, 3001, 3003}
W/InputManagerService( 981): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#40699050
D/szipinf ( 8945): Initializing inflate state
V/$$$$$$ ( 8060): In service onStart: REGISTERED RECEIVER
D/szipinf ( 8945): Initializing inflate state
D/SettingsAppWidgetProvider( 8945): Widget is from a previous version... Let's update
D/SettingsAppWidgetProvider( 8945): No instances yet... Wait for at least one instance to exist before adding global settings
I/ActivityManager( 981): No longer want com.anod.calendar (pid 8541): hidden #16
W/ActivityManager( 981): Scheduling restart of crashed service com.anod.calendar/.services.UpdateService in 5000ms
I/ActivityManager( 981): Start proc com.anod.calendar for service com.anod.calendar/.services.UpdateService: pid=8953 uid=10083 gids={1015}
D/dalvikvm( 967): GC_EXPLICIT freed 12K, 51% free 2674K/5379K, external 0K/0K, paused 133ms
D/szipinf ( 8953): Initializing inflate state
I/ActivityThread( 8953): Pub com.anod.calendar.events.provider: com.anod.calendar.scrollable.ScrollableDataProvider
I/dalvikvm( 8953): Could not find method android.appwidget.AppWidgetManager.notifyAppWidgetViewDataChanged, referenced from method com.anod.calendar.services.UpdateService.updateWidgets
D/dalvikvm( 967): GC_EXPLICIT freed <1K, 51% free 2674K/5379K, external 0K/0K, paused 63ms
W/dalvikvm( 8953): VFY: unable to resolve virtual method 151: Landroid/appwidget/AppWidgetManager;.notifyAppWidgetViewDataChanged ([II)V
D/dalvikvm( 8953): VFY: replacing opcode 0x6e at 0x0024
D/SimpleCal( 8953): Register content observer : 0
D/SimpleCal( 8953): Unregister content observer : 1
D/SimpleCal( 8953): Unregister content observer : 2
D/dalvikvm( 967): GC_EXPLICIT freed <1K, 51% free 2674K/5379K, external 0K/0K, paused 45ms
D/SimpleCal( 8953): Register content observer : 0
D/SimpleCal( 8953): Unregister content observer : 1
D/SimpleCal( 8953): Unregister content observer : 2
D/AndroidRuntime( 8964):
D/AndroidRuntime( 8964): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
I/AndroidRuntime( 8964): Heap size: -Xmx32m
D/AndroidRuntime( 8964): CheckJNI is OFF
D/dalvikvm( 8964): creating instr width table
D/AndroidRuntime( 8964): Calling main entry com.android.commands.pm.Pm
D/AndroidRuntime( 8964): Shutting down VM
D/dalvikvm( 8964): GC_CONCURRENT freed 103K, 70% free 307K/1024K, external 0K/0K, paused 0ms+1ms
D/dalvikvm( 8964): Debugger has detached; object registry had 1 entries
I/AndroidRuntime( 8964): NOTE: attach of thread 'Binder Thread #3' failed
D/AndroidRuntime( 8974):
D/AndroidRuntime( 8974): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
I/AndroidRuntime( 8974): Heap size: -Xmx32m
D/AndroidRuntime( 8974): CheckJNI is OFF
D/dalvikvm( 8974): creating instr width table
D/AndroidRuntime( 8974): Calling main entry com.android.commands.am.Am
I/ActivityManager( 981): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.texaslinuxfest.txlf/.TxlfActivity } from pid 8974
I/ActivityManager( 981): Start proc org.texaslinuxfest.txlf for activity org.texaslinuxfest.txlf/.TxlfActivity: pid=8982 uid=10100 gids={3003, 1006}
D/AndroidRuntime( 8974): Shutting down VM
D/dalvikvm( 8974): GC_CONCURRENT freed 103K, 69% free 325K/1024K, external 0K/0K, paused 0ms+1ms
D/dalvikvm( 8974): Debugger has detached; object registry had 1 entries
I/AndroidRuntime( 8974): NOTE: attach of thread 'Binder Thread #3' failed
E/jdwp ( 8982): Failed sending reply to debugger: Broken pipe
D/dalvikvm( 8982): Debugger has detached; object registry had 1 entries
D/szipinf ( 8982): Initializing inflate state
D/dalvikvm( 8982): GC_EXTERNAL_ALLOC freed 44K, 50% free 2692K/5379K, external 0K/0K, paused 56ms
V/txlf ( 8982): App already installed on your phone
D/txlf ( 8982): Guide hasn't expired
V/txlf ( 8982): Guide is ready - Sessions available
I/ActivityManager( 981): Displayed org.texaslinuxfest.txlf/.TxlfActivity: +406ms (total +4m46s12ms)
V/$$$$$$ ( 8060): In service onStart: REGISTERED RECEIVER
I/ActivityManager( 981): Starting: Intent { cmp=org.texaslinuxfest.txlf/.Sessions (has extras) } from pid 8982
D/Sessions Activity( 8982): Got guide through intent Serializable
W/ResourceType( 8982): getEntry failing because entryIndex 12 is beyond type entryCount 12
W/ResourceType( 8982): Failure getting entry for 0x7f03000c (t=2 e=12) in package 0 (error -2147483647)
D/AndroidRuntime( 8982): Shutting down VM
W/dalvikvm( 8982): threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime( 8982): FATAL EXCEPTION: main
E/AndroidRuntime( 8982): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.texaslinuxfest.txlf/org.texaslinuxfest.txlf.Sessions}: android.content.res.Resources$NotFoundException: Resource ID #0x7f03000c
E/AndroidRuntime( 8982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
E/AndroidRuntime( 8982): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
E/AndroidRuntime( 8982): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
E/AndroidRuntime( 8982): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
E/AndroidRuntime( 8982): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8982): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 8982): at android.app.ActivityThread.main(ActivityThread.java:3835)
E/AndroidRuntime( 8982): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8982): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 8982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
E/AndroidRuntime( 8982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
E/AndroidRuntime( 8982): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 8982): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f03000c
E/AndroidRuntime( 8982): at android.content.res.Resources.getValue(Resources.java:929)
E/AndroidRuntime( 8982): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1955)
E/AndroidRuntime( 8982): at android.content.res.Resources.getLayout(Resources.java:768)
E/AndroidRuntime( 8982): at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
E/AndroidRuntime( 8982): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
E/AndroidRuntime( 8982): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:212)
E/AndroidRuntime( 8982): at android.app.Activity.setContentView(Activity.java:1657)
E/AndroidRuntime( 8982): at org.texaslinuxfest.txlf.Sessions.onCreate(Sessions.java:70)
E/AndroidRuntime( 8982): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 8982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
E/AndroidRuntime( 8982): ... 11 more
W/ActivityManager( 981): Force finishing activity org.texaslinuxfest.txlf/.Sessions
W/ActivityManager( 981): Force finishing activity org.texaslinuxfest.txlf/.TxlfActivity
W/ActivityManager( 981): Activity pause timeout for HistoryRecord{40708c48 org.texaslinuxfest.txlf/.Sessions}
I/ActivityManager( 981): No longer want com.android.defcontainer (pid 8900): hidden #16
I/Process ( 8982): Sending signal. PID: 8982 SIG: 9
I/ActivityManager( 981): Process org.texaslinuxfest.txlf (pid 8982) has died.
I/WindowManager( 981): WIN DEATH: Window{407c4aa8 org.texaslinuxfest.txlf/org.texaslinuxfest.txlf.TxlfActivity paused=true}
D/dalvikvm( 981): GC_CONCURRENT freed 1979K, 51% free 7640K/15431K, external 3673K/3889K, paused 12ms+11ms
Right Now it just errors out, two commits prior I had one primary Viewflipper working, but nesting it seems to have broken things... even after manually adding listviews to the nested viewflipper (instead of using a generic method).
I am having trouble assigning assigning the SubTypes to the appropriate subViewflipper. Does anyone have an example of this either XML or programmatically? I have yet to find any examples on using nested viewflippers. Optionally tab host might work, but I would prefer text-only buttons and do like the animations that come with viewflipper.
GITHUB repo: https://github.com/agoransson/nested_view_flippers
Okay, this will be a big answer... but I hope it's what you were looking for.
The activity:
private GestureDetector gestureScanner;
private ViewFlipper rootFlipper;
private ViewFlipper flipper1, flipper2;
private Animation animFlipInNext, animFlipOutNext;
private Animation animFlipInPrevious, animFlipOutPrevious;
private Animation rootAnimFlipInNext, rootAnimFlipOutNext;
private Animation rootAnimFlipInPrevious, rootAnimFlipOutPrevious;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Root flipper
rootFlipper = (ViewFlipper) findViewById(R.id.rootFlipper);
// Content flippers
flipper1 = (ViewFlipper) findViewById(R.id.viewFlipper1);
flipper2 = (ViewFlipper) findViewById(R.id.viewFlipper2);
gestureScanner = new GestureDetector(this);
// Animations
animFlipInNext = AnimationUtils.loadAnimation(this, R.anim.flipinnext);
animFlipOutNext = AnimationUtils.loadAnimation(this, R.anim.flipoutnext);
animFlipInPrevious = AnimationUtils.loadAnimation(this,
R.anim.flipinprevious);
animFlipOutPrevious = AnimationUtils.loadAnimation(this,
R.anim.flipoutprevious);
rootAnimFlipInNext = AnimationUtils.loadAnimation(this,
R.anim.rootflipinnext);
rootAnimFlipOutNext = AnimationUtils.loadAnimation(this,
R.anim.rootflipoutnext);
rootAnimFlipInPrevious = AnimationUtils.loadAnimation(this,
R.anim.rootflipinprevious);
rootAnimFlipOutPrevious = AnimationUtils.loadAnimation(this,
R.anim.rootflipoutprevious);
}
#Override
public boolean onTouchEvent(MotionEvent event) {
return gestureScanner.onTouchEvent(event);
}
#Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
Log.i("TEST", "Fling!!");
if (Math.abs(velocityY) > Math.abs(velocityX)) {
if (velocityY > 0) {
rootFlipper.setInAnimation(rootAnimFlipInNext);
rootFlipper.setOutAnimation(rootAnimFlipOutNext);
rootFlipper.showNext();
} else if (velocityY < 0) {
rootFlipper.setInAnimation(rootAnimFlipInPrevious);
rootFlipper.setOutAnimation(rootAnimFlipOutPrevious);
rootFlipper.showPrevious();
}
} else {
if (velocityX > 0) {
ViewFlipper v = (ViewFlipper) rootFlipper.getCurrentView();
v.setInAnimation(animFlipInNext);
v.setOutAnimation(animFlipOutNext);
v.showNext();
} else if (velocityX < 0) {
ViewFlipper v = (ViewFlipper) rootFlipper.getCurrentView();
v.setInAnimation(animFlipInPrevious);
v.setOutAnimation(animFlipOutPrevious);
v.showPrevious();
}
}
return true;
}
The layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ViewFlipper
android:id="#+id/rootFlipper"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ViewFlipper
android:id="#+id/viewFlipper1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/innerone"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff0000"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 1-1"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:id="#+id/innertwo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff0000"
android:orientation="vertical" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 1-2"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:id="#+id/innerthree"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff0000"
android:orientation="vertical" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 1-3"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</ViewFlipper>
<ViewFlipper
android:id="#+id/viewFlipper2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/innerone"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00ff00"
android:orientation="vertical" >
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 2-1"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:id="#+id/innertwo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00ff00"
android:orientation="vertical" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 2-2"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:id="#+id/innerthree"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00ff00"
android:orientation="vertical" >
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LAYOUT 2-3"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</ViewFlipper>
</ViewFlipper>
</LinearLayout>
The animations:
flipinnext.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="#android:anim/decelerate_interpolator" >
<translate
android:duration="500"
android:fromXDelta="-100%"
android:toXDelta="0%" />
</set>
flipinprevious.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="#android:anim/decelerate_interpolator" >
<translate
android:duration="500"
android:fromXDelta="100%"
android:toXDelta="0%" />
</set>
flipoutnext.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="#android:anim/decelerate_interpolator" >
<translate
android:duration="500"
android:fromXDelta="0%"
android:toXDelta="100%" />
</set>
flipoutprevious.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="#android:anim/decelerate_interpolator" >
<translate
android:duration="500"
android:fromXDelta="0%"
android:toXDelta="-100%" />
</set>
And then you need a set of almost identical animations for the root flip (y-axis). Just copy the x-axis animations and change the translate attributes to the Y-axis.
Related
D/AndroidRuntime(11752):
D/AndroidRuntime(11752): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime(11752): CheckJNI is ON
D/dalvikvm(11752): creating instr width table
E/jdwp (11752): pipe failed
W/ProcessState(11752): Opening '/dev/binder' failed: Too many open files
D/AndroidRuntime(11752): Calling main entry com.android.commands.am.Am
I/Mamarduke_Diag( 1726): Data is available now.
I/Mamarduke_Diag( 1726): exec result -->>> java.lang.NullPointerException
I/DMIC ( 1726): ---> java.lang.NullPointerException
I/System.out( 1726): *****wifi state end=1
D/dalvikvm( 1726): GC_EXPLICIT freed 31K, 41% free 7507K/12551K, external 1625K/2137K, paused 58ms
D/dalvikvm( 1726): GC_EXPLICIT freed 0K, 41% free 7507K/12551K, external 1625K/2137K, paused 58ms
I/System.out( 1726): ***run in test i=7,camera
I/System.out( 1726): ***run in test i=8,cec
I/System.out( 1726): ***run in test i=9,edid
I/System.out( 1726): *****wifi state start=1
I/Mamarduke_Diag( 1726): Data is available now.
I/Mamarduke_Diag( 1726): exec result -->>>
I/System.out( 1726): *****wifi state end=1
D/dalvikvm( 1726): GC_EXPLICIT freed 36K, 41% free 7474K/12551K, external 1625K/2137K, paused 57ms
D/dalvikvm( 1726): GC_EXPLICIT freed 0K, 41% free 7474K/12551K, external 1625K/2137K, paused 58ms
I/System.out( 1726): ***run in test i=10,iris
I/System.out( 1726): *****wifi state start=1
I/ActivityManager( 1491): Starting: Intent { act=com.android.camera.irison flg=0x10000000 cmp=com.ianc.apd/.testcase.cameraex.ImageCamera } from pid 1726
I/System.out( 1726): onCreate
I/System.out( 1726): onResume
I/System.out( 1726): test irist on
I/System.out( 1726): excuteCmd/sys/bus/spi/devices/spi2.0/irisstate
E/InputDispatcher( 1491): channel '40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera (server)' ~ Consumer closed input channel or an error occurred. events=0x8
E/InputDispatcher( 1491): channel '40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera (server)' ~ Channel is unrecoverably broken and will be disposed!
D/AndroidRuntime( 1726): Shutting down VM
W/dalvikvm( 1726): threadid=1: thread exiting with uncaught exception (group=0x40015560)
I/WindowManager( 1491): WINDOW DIED Window{40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera paused=false}
E/AndroidRuntime( 1726): FATAL EXCEPTION: main
E/AndroidRuntime( 1726): java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
E/AndroidRuntime( 1726): at android.view.InputChannel.nativeReadFromParcel(Native Method)
E/AndroidRuntime( 1726): at android.view.InputChannel.readFromParcel(InputChannel.java:138)
E/AndroidRuntime( 1726): at android.view.IWindowSession$Stub$Proxy.add(IWindowSession.java:409)
E/AndroidRuntime( 1726): at android.view.ViewRoot.setView(ViewRoot.java:498)
E/AndroidRuntime( 1726): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
E/AndroidRuntime( 1726): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/AndroidRuntime( 1726): at android.view.Window$LocalWindowManager.addView(Window.java:424)
E/AndroidRuntime( 1726): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2170)
E/AndroidRuntime( 1726): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
E/AndroidRuntime( 1726): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 1726): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime( 1726): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1726): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1726): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 1726): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1726): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1726): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 1726): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 1726): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1491): Force finishing activity com.ianc.apd/.testcase.cameraex.ImageCamera
W/ActivityManager( 1491): Activity pause timeout for HistoryRecord{4069a248 com.ianc.apd/.testcase.cameraex.ImageCamera}
Why do Consumer closed input channel or an error occurred. events=0x8 happen after many times running? That is too say, my program can run at first, but after many times, the exception happen.
I read this: Input transport and input dispatcher error on 2.3, but I have no idea how to solve it!! Who can help me?
I run my program in real device. The android version is 2.3
Update 1:
I found the root cause of Could not read input channel file descriptors from parcel.
It is E/jdwp (11752): pipe failed.
Why do create pipe failed? Because the pipe is out of the max in the system. that is to say, we create a lot of pipe or file descriptors in the system. And then we found the reason and try to modify it: My friend change the code like that in his Activity: `Original source code:
private class MyHandler extends Handler {
MyHandler(Looper looper) {
super(looper);
}
#Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RELEASE_CAMERA:
synchronized (CameraHolder.this) {
// In 'CameraHolder.open', the 'RELEASE_CAMERA' message
// will be removed if it is found in the queue. However,
// there is a chance that this message has been handled
// before being removed. So, we need to add a check
// here:
if (CameraHolder.this.mUsers == 0) releaseCamera();
}
break;
}
}
}
...
HandlerThread ht = new HandlerThread("CameraHolder");
ht.start();
mHandler = new MyHandler(ht.getLooper());
change to
private class MyHandler extends Handler {
MyHandler(Looper looper) {
super(looper);
}
#Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RELEASE_CAMERA:
synchronized (CameraHolder.this) {
// In 'CameraHolder.open', the 'RELEASE_CAMERA' message
// will be removed if it is found in the queue. However,
// there is a chance that this message has been handled
// before being removed. So, we need to add a check
// here:
if (CameraHolder.this.mUsers == 0) releaseCamera();
}
break;
}
}
}
mHandler = new MyHandler();
Those file descriptors will reduce obviously. Why? how to explain this case? And I add mHandler.removemessage this function to onPause in my Activity. And Those file descriptors also reduce obviously. why? who can explain this case for me? I am trying to understand this.
Benni05 found a solution here, by setting android:configChanges="orientation" property for activity #AndroidManifest. It work for me(where i get an error with api lvl.11 installed devices). Good luck!
it is most probably because of having a wrong xml resource file. for me i put colors in strings.xml and got this errors. then i created colors.xml and now it works.
I'm trying to make an app for a website, basically just loads the website. I know how to make it and everything, and I've set up webviews, but I'm not sure what I'm doing wrong.
So basically my main class loads a menu, it has buttons for like home, forums, inbox, etc. That all works fine, but when I hit a button, that calls the webview, and that's when it crashes.
Here's my code for the webview:
public class OpenHome extends Activity{
WebView myWebView;
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
WebView myWebView = (WebView) findViewById(R.id.WebView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl("http://www.se7ensins.com");
}
#Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// Check if the key event was the BACK key and if there's history
if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) {
myWebView.goBack();
return true;
}
// If it wasn't the BACK key or there's no web page history, bubble up to the default
// system behavior (probably exit the activity)
return super.onKeyDown(keyCode, event);
}
I have all the imports and stuff, but when I run the webview and try to load the page, it just unexpectedly closes the app, also I enabled internet permissions in the android manifest.
Here's the Logcat:
09-03 06:08:03.287: DEBUG/AndroidRuntime(563): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
09-03 06:08:03.287: DEBUG/AndroidRuntime(563): CheckJNI is ON
09-03 06:08:04.177: DEBUG/AndroidRuntime(563): Calling main entry com.android.commands.pm.Pm
09-03 06:08:04.217: DEBUG/AndroidRuntime(563): Shutting down VM
09-03 06:08:04.237: DEBUG/dalvikvm(563): GC_CONCURRENT freed 100K, 84% free 339K/2048K, paused 0ms+0ms
09-03 06:08:04.237: INFO/AndroidRuntime(563): NOTE: attach of thread 'Binder Thread #3' failed
09-03 06:08:04.247: DEBUG/jdwp(563): Got wake-up signal, bailing out of select
09-03 06:08:04.247: DEBUG/dalvikvm(563): Debugger has detached; object registry had 1 entries
09-03 06:08:04.887: DEBUG/AndroidRuntime(573): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
09-03 06:08:04.887: DEBUG/AndroidRuntime(573): CheckJNI is ON
09-03 06:08:05.886: DEBUG/AndroidRuntime(573): Calling main entry com.android.commands.am.Am
09-03 06:08:05.936: INFO/ActivityManager(79): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.clepto.sinnergy/.SinnergyActivity } from pid 573
09-03 06:08:05.969: WARN/WindowManager(79): Failure taking screenshot for (230x143) to layer 21005
09-03 06:08:05.996: INFO/ActivityManager(79): Start proc com.clepto.sinnergy for activity com.clepto.sinnergy/.SinnergyActivity: pid=581 uid=10036 gids={3003}
09-03 06:08:06.057: DEBUG/AndroidRuntime(573): Shutting down VM
09-03 06:08:06.086: INFO/AndroidRuntime(573): NOTE: attach of thread 'Binder Thread #3' failed
09-03 06:08:06.186: DEBUG/dalvikvm(573): GC_CONCURRENT freed 101K, 83% free 364K/2048K, paused 1ms+1ms
09-03 06:08:06.186: DEBUG/jdwp(573): Got wake-up signal, bailing out of select
09-03 06:08:06.186: DEBUG/dalvikvm(573): Debugger has detached; object registry had 1 entries
09-03 06:08:08.057: DEBUG/dalvikvm(581): GC_FOR_ALLOC freed 32K, 3% free 6345K/6531K, paused 71ms
09-03 06:08:08.078: INFO/dalvikvm-heap(581): Grow heap (frag case) to 6.828MB for 614416-byte allocation
09-03 06:08:08.186: DEBUG/dalvikvm(581): GC_FOR_ALLOC freed <1K, 4% free 6945K/7175K, paused 79ms
09-03 06:08:08.356: DEBUG/dalvikvm(581): GC_CONCURRENT freed <1K, 4% free 6945K/7175K, paused 20ms+3ms
09-03 06:08:08.616: DEBUG/dalvikvm(147): GC_EXPLICIT freed 7K, 18% free 14098K/17159K, paused 5ms+376ms
09-03 06:08:08.656: DEBUG/dalvikvm(581): GC_CONCURRENT freed 779K, 12% free 6715K/7559K, paused 5ms+3ms
09-03 06:08:08.676: VERBOSE/TLINE(581): new: android.text.TextLine#4063b850
09-03 06:08:09.216: VERBOSE/TLINE(581): new: android.text.TextLine#4072ad08
09-03 06:08:09.279: INFO/ActivityManager(79): Displayed com.clepto.sinnergy/.SinnergyActivity: +3s288ms
09-03 06:08:10.216: DEBUG/dalvikvm(147): GC_EXPLICIT freed <1K, 18% free 14099K/17159K, paused 229ms+4ms
09-03 06:08:13.236: INFO/ActivityManager(79): Starting: Intent { act=com.clepto.sinnergy.OPENHOME } from pid 581
09-03 06:08:13.247: DEBUG/AndroidRuntime(581): Shutting down VM
09-03 06:08:13.247: WARN/dalvikvm(581): threadid=1: thread exiting with uncaught exception (group=0x40014760)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): FATAL EXCEPTION: main
09-03 06:08:13.256: ERROR/AndroidRuntime(581): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.clepto.sinnergy.OPENHOME }
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1382)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.app.Activity.startActivityForResult(Activity.java:3095)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.app.Activity.startActivity(Activity.java:3201)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at com.clepto.sinnergy.SinnergyActivity$1.onClick(SinnergyActivity.java:34)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.view.View.performClick(View.java:3110)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.view.View$PerformClick.run(View.java:11928)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.os.Handler.handleCallback(Handler.java:587)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.os.Handler.dispatchMessage(Handler.java:92)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.os.Looper.loop(Looper.java:132)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at android.app.ActivityThread.main(ActivityThread.java:4025)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at java.lang.reflect.Method.invokeNative(Native Method)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at java.lang.reflect.Method.invoke(Method.java:491)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
09-03 06:08:13.256: ERROR/AndroidRuntime(581): at dalvik.system.NativeStart.main(Native Method)
09-03 06:08:13.276: WARN/ActivityManager(79): Force finishing activity com.clepto.sinnergy/.SinnergyActivity
09-03 06:08:13.276: WARN/WindowManager(79): Failure taking screenshot for (230x143) to layer 21010
09-03 06:08:13.800: WARN/ActivityManager(79): Activity pause timeout for ActivityRecord{41470780 com.clepto.sinnergy/.SinnergyActivity}
09-03 06:08:16.542: INFO/Process(581): Sending signal. PID: 581 SIG: 9
09-03 06:08:16.566: INFO/ActivityManager(79): Process com.clepto.sinnergy (pid 581) has died.
09-03 06:08:16.566: INFO/WindowManager(79): WIN DEATH: Window{4144bae8 com.clepto.sinnergy/com.clepto.sinnergy.SinnergyActivity paused=false}
09-03 06:08:16.696: WARN/InputManagerService(79): Got RemoteException sending setActive(false) notification to pid 581 uid 10036
09-03 06:08:16.930: INFO/dalvikvm(79): Jit: resizing JitTable from 2048 to 4096
09-03 06:08:22.138: DEBUG/SntpClient(79): request time failed: java.net.SocketException: Address family not supported by protocol
09-03 06:08:24.788: WARN/ActivityManager(79): Activity destroy timeout for ActivityRecord{41470780 com.clepto.sinnergy/.SinnergyActivity}
I think your code is almost perfect..
just need to change one line
write this line
myWebView = (WebView) findViewById(R.id.WebView);
instead of
WebView myWebView = (WebView) findViewById(R.id.WebView);
just remove WebView object bcz you already define in global..
and may be some problem in you webview.xml file ?
check it first.
here is samle code for webview.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.webkit.WebView android:id="#+id/WebView"
android:layout_width="fill_parent" android:layout_height="fill_parent">
</android.webkit.WebView>
</LinearLayout>
Update
One thing did you add .OpenHome activity in your menifest.xml file
How to check LogCat
go Window >> Show view >> other >> Android >> LogCat
How to add activity in menifest.xml
open AndroidMenifest.xml from you project directory
and add this line
<activity android:name=".OpenHome"></activity>
how to start new activity
Intent intent = new Intent(your_main_class.this,OpenHome.class);
startActivity(intent);
where your_main_class is your main class name .
This is not because of webview.
FATAL EXCEPTION: main 09-03 06:08:13.256: ERROR/AndroidRuntime(581):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=com.clepto.sinnergy.OPENHOME }
This error is because of the activity is not defined in manifest.
Verify the package and class name of your activity in manifest carefully.
I'm having a simple problem with starting an intent on the click of a button. Unfortunately, i can't find a way out of this problem.
MY first activity java file is :
package com.android.SamsungMIv3;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class SamsungMIv3Activity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button)findViewById(R.id.button1);
b.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i = new Intent(SamsungMIv3Activity.this, currentlocation.class);
SamsungMIv3Activity.this.startActivity(i);
}
});
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:padding="10dp"
>
<Button
android:text="MY LOCATION"
android:id="#+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:padding="10dp"
>
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="ENTER TEXT"
android:id="#+id/textView2">
</TextView>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:padding="10dp"
>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="#+id/editText1"
android:inputType="textMultiLine">
<requestFocus></requestFocus>
</EditText>
</ScrollView>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:padding="10dp"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="fill_parent"
android:paddingRight="20dp"
>
<Button
android:text="Camera"
android:id="#+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="fill_parent"
>
<Button
android:text="Search Location"
android:id="#+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:padding="10dp"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="fill_parent"
android:paddingRight="20dp"
>
<Button
android:text="Facebook"
android:id="#+id/button4"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="fill_parent"
android:paddingRight="20dp"
>
<Button
android:text="Twitter"
android:id="#+id/button5"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Second activity java file :
package com.android.SamsungMIv3;
import android.os.Bundle;
import android.widget.TextView;
import com.google.android.maps.MapActivity;
public class currentlocation extends MapActivity {
#Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.currentlocation);
// TextView t = new TextView(this);
//t.setText("New Activity started");
}
#Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
second activity xml file :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This works"
android:id="#+id/textView1"></TextView>
</LinearLayout>
manifest file :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.SamsungMIv3"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".SamsungMIv3Activity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".currentlocation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Log Cat :
07-09 14:26:31.352: DEBUG/AndroidRuntime(821): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-09 14:26:31.362: DEBUG/AndroidRuntime(821): CheckJNI is ON
07-09 14:26:31.932: DEBUG/AndroidRuntime(821): --- registering native functions ---
07-09 14:26:32.852: DEBUG/ddm-heap(821): Got feature list request
07-09 14:26:33.912: DEBUG/PackageParser(58): Scanning package: /data/app/vmdl72937.tmp
07-09 14:26:33.942: WARN/PackageParser(58): No actions in intent filter at /data/app/vmdl72937.tmp Binary XML file line #20
07-09 14:26:34.202: INFO/PackageManager(58): Removing non-system package:com.android.SamsungMIv3
07-09 14:26:34.202: DEBUG/PackageManager(58): Removing package com.android.SamsungMIv3
07-09 14:26:34.222: DEBUG/PackageManager(58): Activities: com.android.SamsungMIv3.SamsungMIv3Activity com.android.SamsungMIv3.currentlocation
07-09 14:26:34.402: DEBUG/PackageManager(58): Scanning package com.android.SamsungMIv3
07-09 14:26:34.422: INFO/PackageManager(58): /data/app/vmdl72937.tmp changed; unpacking
07-09 14:26:34.452: DEBUG/installd(31): DexInv: --- BEGIN '/data/app/vmdl72937.tmp' ---
07-09 14:26:35.012: DEBUG/dalvikvm(827): DexOpt: load 91ms, verify 109ms, opt 8ms
07-09 14:26:35.062: DEBUG/installd(31): DexInv: --- END '/data/app/vmdl72937.tmp' (success) ---
07-09 14:26:35.072: DEBUG/PackageManager(58): Activities: com.android.SamsungMIv3.SamsungMIv3Activity com.android.SamsungMIv3.currentlocation
07-09 14:26:35.083: DEBUG/ActivityManager(58): Uninstalling process com.android.SamsungMIv3
07-09 14:26:35.332: INFO/installd(31): move /data/dalvik-cache/data#app#vmdl72937.tmp#classes.dex -> /data/dalvik-cache/data#app#com.android.SamsungMIv3.apk#classes.dex
07-09 14:26:35.358: DEBUG/PackageManager(58): New package installed in /data/app/com.android.SamsungMIv3.apk
07-09 14:26:35.562: DEBUG/AndroidRuntime(821): Shutting down VM
07-09 14:26:35.582: DEBUG/dalvikvm(821): DestroyJavaVM waiting for non-daemon threads to exit
07-09 14:26:35.605: DEBUG/dalvikvm(821): DestroyJavaVM shutting VM down
07-09 14:26:35.605: DEBUG/dalvikvm(821): HeapWorker thread shutting down
07-09 14:26:35.622: DEBUG/dalvikvm(821): HeapWorker thread has shut down
07-09 14:26:35.642: DEBUG/jdwp(821): JDWP shutting down net...
07-09 14:26:35.642: INFO/dalvikvm(821): Debugger has detached; object registry had 1 entries
07-09 14:26:35.662: DEBUG/dalvikvm(821): VM cleaning up
07-09 14:26:35.673: ERROR/AndroidRuntime(821): ERROR: thread attach failed
07-09 14:26:35.732: DEBUG/ActivityManager(58): Uninstalling process com.android.SamsungMIv3
07-09 14:26:35.842: DEBUG/dalvikvm(821): LinearAlloc 0x0 used 623012 of 5242880 (11%)
07-09 14:26:36.272: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f0700e5
07-09 14:26:36.286: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f020031
07-09 14:26:36.293: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f020030
07-09 14:26:36.302: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f050000
07-09 14:26:36.432: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f060001
07-09 14:26:36.602: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f060000
07-09 14:26:36.922: DEBUG/dalvikvm(105): GC freed 44 objects / 1752 bytes in 693ms
07-09 14:26:37.482: DEBUG/dalvikvm(58): GC freed 19390 objects / 1061480 bytes in 676ms
07-09 14:26:38.292: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f0700e5
07-09 14:26:38.312: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f020031
07-09 14:26:38.312: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f020030
07-09 14:26:38.322: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f050000
07-09 14:26:38.552: INFO/ActivityManager(58): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=833 uid=10019 gids={}
07-09 14:26:39.573: DEBUG/dalvikvm(58): GC freed 3548 objects / 181408 bytes in 1007ms
07-09 14:26:39.662: DEBUG/AndroidRuntime(832): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-09 14:26:39.712: DEBUG/AndroidRuntime(832): CheckJNI is ON
07-09 14:26:39.792: DEBUG/ddm-heap(833): Got feature list request
07-09 14:26:40.354: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f060001
07-09 14:26:40.722: WARN/ResourceType(58): Resources don't contain package for resource number 0x7f060000
07-09 14:26:41.133: DEBUG/AndroidRuntime(832): --- registering native functions ---
07-09 14:26:44.233: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.SamsungMIv3/.SamsungMIv3Activity }
07-09 14:26:44.372: DEBUG/AndroidRuntime(832): Shutting down VM
07-09 14:26:44.372: DEBUG/dalvikvm(832): DestroyJavaVM waiting for non-daemon threads to exit
07-09 14:26:44.393: DEBUG/dalvikvm(832): DestroyJavaVM shutting VM down
07-09 14:26:44.412: DEBUG/dalvikvm(832): HeapWorker thread shutting down
07-09 14:26:44.412: DEBUG/dalvikvm(832): HeapWorker thread has shut down
07-09 14:26:44.412: DEBUG/jdwp(832): JDWP shutting down net...
07-09 14:26:44.412: INFO/dalvikvm(832): Debugger has detached; object registry had 1 entries
07-09 14:26:44.432: DEBUG/dalvikvm(832): VM cleaning up
07-09 14:26:44.492: ERROR/AndroidRuntime(832): ERROR: thread attach failed
07-09 14:26:44.842: DEBUG/dalvikvm(832): LinearAlloc 0x0 used 637524 of 5242880 (12%)
07-09 14:26:45.762: DEBUG/ddm-heap(845): Got feature list request
07-09 14:26:45.963: INFO/ActivityManager(58): Start proc com.android.SamsungMIv3 for activity com.android.SamsungMIv3/.SamsungMIv3Activity: pid=845 uid=10032 gids={}
07-09 14:26:47.083: WARN/dalvikvm(845): Unable to resolve superclass of Lcom/android/SamsungMIv3/currentlocation; (17)
07-09 14:26:47.092: WARN/dalvikvm(845): Link of class 'Lcom/android/SamsungMIv3/currentlocation;' failed
07-09 14:26:47.102: ERROR/dalvikvm(845): Could not find class 'com.android.SamsungMIv3.currentlocation', referenced from method com.android.SamsungMIv3.SamsungMIv3Activity$1.onClick
07-09 14:26:47.112: WARN/dalvikvm(845): VFY: unable to resolve const-class 16 (Lcom/android/SamsungMIv3/currentlocation;) in Lcom/android/SamsungMIv3/SamsungMIv3Activity$1;
07-09 14:26:47.112: DEBUG/dalvikvm(845): VFY: replacing opcode 0x1c at 0x0004
07-09 14:26:47.112: DEBUG/dalvikvm(845): Making a copy of Lcom/android/SamsungMIv3/SamsungMIv3Activity$1;.onClick code (48 bytes)
07-09 14:26:47.752: INFO/ActivityManager(58): Displayed activity com.android.SamsungMIv3/.SamsungMIv3Activity: 3402 ms (total 3402 ms)
07-09 14:26:48.102: ERROR/gralloc(58): [unregister] handle 0x4a92b8 still locked (state=40000001)
07-09 14:26:51.414: DEBUG/AndroidRuntime(845): Shutting down VM
07-09 14:26:51.422: WARN/dalvikvm(845): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
07-09 14:26:51.432: ERROR/AndroidRuntime(845): Uncaught handler: thread main exiting due to uncaught exception
07-09 14:26:51.472: ERROR/AndroidRuntime(845): java.lang.NoClassDefFoundError: com.android.SamsungMIv3.currentlocation
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.SamsungMIv3.SamsungMIv3Activity$1.onClick(SamsungMIv3Activity.java:21)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.View.performClick(View.java:2364)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.View.onTouchEvent(View.java:4179)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.widget.TextView.onTouchEvent(TextView.java:6540)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.View.dispatchTouchEvent(View.java:3709)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.os.Looper.loop(Looper.java:123)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at android.app.ActivityThread.main(ActivityThread.java:4363)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at java.lang.reflect.Method.invokeNative(Native Method)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at java.lang.reflect.Method.invoke(Method.java:521)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-09 14:26:51.472: ERROR/AndroidRuntime(845): at dalvik.system.NativeStart.main(Native Method)
07-09 14:26:51.542: INFO/Process(58): Sending signal. PID: 845 SIG: 3
07-09 14:26:51.553: INFO/dalvikvm(845): threadid=7: reacting to signal 3
07-09 14:26:51.602: INFO/dalvikvm(845): Wrote stack trace to '/data/anr/traces.txt'
07-09 14:26:53.502: DEBUG/dalvikvm(105): GC freed 2414 objects / 140960 bytes in 312ms
07-09 14:26:57.862: INFO/Process(845): Sending signal. PID: 845 SIG: 9
07-09 14:26:58.053: INFO/ActivityManager(58): Process com.android.SamsungMIv3 (pid 845) has died.
07-09 14:26:58.073: INFO/WindowManager(58): WIN DEATH: Window{44d6f5c0 com.android.SamsungMIv3/com.android.SamsungMIv3.SamsungMIv3Activity paused=false}
07-09 14:26:58.292: INFO/UsageStats(58): Unexpected resume of com.android.launcher while already resumed in com.android.SamsungMIv3
07-09 14:26:58.532: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 845 uid 10032
I understand that the loc cat points to an error at the line
Intent i = new Intent(...);
But I'm not able to find a way to resolve this problem
Your activity depends on MapActivity, but you have not included these dependent classes in your app. See: "Unable to resolve superclass of Lcom/android/SamsungMIv3/currentlocation"
It seems that you manifest need too clarify that you'll use map lib
<uses-library android:name="com.google.android.maps" />
Try removing the following from your manifest.xml in the currentLocation activity:
<category android:name="android.intent.category.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /
There should only be one main and one launcher class. Perhaps that's it.
If you are using android studio try
./gradlew clean && ./gradlew build
Look for build.gradle in your application directory
//build.gradle
n check under dependencies whether ur file is included or not
e.g
dependencies {
compile 'com.android.support:support-v13:18.0.0'
}
I wanted to add support v-13 files so I added the same in compile path and same files
should be there in support library of SDK. e.g.
sdk/extras/android/support/v13/android-support-v13.jar
In eclipse, I think you have to look under JAVA-BUILD path.
The spinning globe application unning on the emulator works on android 1.5 as target but puts out a "force close application" error in android 2.2 target. Where should i look to find the problem ?
I have enclosed the logcat details that I get,
D/MediaScanner( 183): prescan time: 4913ms
D/MediaScanner( 183): scan time: 693ms
D/MediaScanner( 183): postscan time: 45ms
D/MediaScanner( 183): total time: 5651ms
D/MediaScannerService( 183): done scanning volume internal
I/PackageManager( 67): Removing non-system package:com.android.SpinningGlobe
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
D/dalvikvm( 127): GC_EXPLICIT freed 12963 objects / 655936 bytes in 168ms
D/PackageManager( 67): Scanning package com.android.SpinningGlobe
I/PackageManager( 67): Package com.android.SpinningGlobe codePath changed from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk; Retaining data and using new
I/PackageManager( 67): /data/app/com.android.SpinningGlobe-1.apk changed; unpacking
D/installd( 34): DexInv: --- BEGIN '/data/app/com.android.SpinningGlobe-1.apk' ---
D/dalvikvm( 255): DexOpt: load 214ms, verify 229ms, opt 5ms
D/installd( 34): DexInv: --- END '/data/app/com.android.SpinningGlobe-1.apk' success)---
W/PackageManager( 67): Code path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk
W/PackageManager( 67): Resource path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
D/PackageManager( 67): Activities: com.android.SpinningGlobe.GLApp
I/installd( 34): move /data/dalvik-cache/data#app#com.android.SpinningGlobe-1.apk#classes.dex -> /data/dalvik-cache/data#app#com.android.SpinningGlobe-1.apk#classes.dex
D/PackageManager( 67): New package installed in /data/app/com.android.SpinningGlobe-1.apk
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
I/ActivityManager( 67): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=256 uid=10028 gids={}
D/dalvikvm( 167): GC_EXPLICIT freed 3943 objects / 244424 bytes in 1708ms
D/dalvikvm( 67): GC_EXPLICIT freed 7297 objects / 468432 bytes in 667ms
W/RecognitionManagerService( 67): no available voice recognition services found
I/ActivityThread( 256): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider
I/installd( 34): unlink /data/dalvik-cache/data#app#com.android.SpinningGlobe-2.apk#classes.dex
D/AndroidRuntime( 118): Shutting down VM
D/jdwp ( 118): adbd disconnected
I/AndroidRuntime( 118): NOTE: attach of thread 'Binder Thread #3' failed
D/AndroidRuntime( 266):
D/AndroidRuntime( 266): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 266): CheckJNI is ON
D/AndroidRuntime( 266): --- registering native functions ---
I/ActivityManager( 67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.SpinningGlobe/.GLApp }
D/AndroidRuntime( 266): Shutting down VM
D/jdwp ( 266): adbd disconnected
I/AndroidRuntime( 266): NOTE: attach of thread 'Binder Thread #3' failed
I/ActivityManager( 67): Start proc com.android.SpinningGlobe for activity com.android.SpinningGlobe/.GLApp: pid=273 uid=10038 gids={1015}
I/ARMAssembler( 67): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x32b4a0:0x32b5ac] in 3627836 ns
D/libEGL ( 273): egl.cfg not found, using default config
D/libEGL ( 273): loaded /system/lib/egl/libGLES_android.so
D/dalvikvm( 273): GC_EXTERNAL_ALLOC freed 839 objects / 59328 bytes in 151ms
W/dalvikvm( 273): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
I/ActivityManager( 67): Displayed activity com.android.SpinningGlobe/.GLApp: 4870 ms (total 4870 ms)
E/AndroidRuntime( 273): FATAL EXCEPTION: GLThread 8
E/AndroidRuntime( 273): java.lang.IndexOutOfBoundsException
E/AndroidRuntime( 273): at java.nio.IntArrayBuffer.get(IntArrayBuffer.java:63)
E/AndroidRuntime( 273): at com.android.SpinningGlobe.GLRenderer.onDrawFrame(GLRenderer.java:105)
E/AndroidRuntime( 273): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
E/AndroidRuntime( 273): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
W/ActivityManager( 67): Force finishing activity com.android.SpinningGlobe/.GLApp
I/ARMAssembler( 67): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x33f9a8:0x33fa64] in 1258819 ns
Any insights on where the problem could be ?
You should look at the log from the emulator.
You can get this on the command line using:
adb logcat
Or if you're using the ADT Plugin for Eclipse the log is visible there. If you can't see it select Window ▶ Show View ▶ Other... and then select Android ▶ LogCat.
It's probably also worth reading the Debugging page in the Android Developer Documentation.
Recompile it under 2.2 and look for deprecated warnings
I am creating an application that checks the installation of a package and then launches the market-place with its id.
When I try to launch market place with id of an application say com.mybrowser.android by throwing an intent android.intent.action.VIEW with url: market://details?id=com.mybrowser.android, the market place application does launches but crashes after launch.
Note: the application com.mybrowser.android doesn't exists in the market-place.
MyApplication is my application.
$ adb logcat
I/ActivityManager( 1030): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=myapp.testapp/.MyApplication }
I/ActivityManager( 1030): Start proc myapp.testapp for activity myapp.testapp/.MyApplication: pid=3858 uid=10047 gids={1015, 3003}
I/MyApplication( 3858): [ Activity CREATED ]
I/MyApplication( 3858): [ Activity STARTED ]
I/MyApplication( 3858): onResume
D/dalvikvm( 1109): GC freed 6571 objects / 423480 bytes in 73ms
I/MyApplication( 3858): Pressed OK button
I/MyApplication( 3858): Broadcasting Intent: android.intent.action.VIEW, data: market://details?id=com.mybrowser.android
I/ActivityManager( 1030): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.mybrowser.android flg=0x10000000 cmp=com.android.ven
ding/.AssetInfoActivity }
I/MyApplication( 3858): onPause
I/ActivityManager( 1030): Start proc com.android.vending for activity com.android.vending/.AssetInfoActivity: pid=3865 uid=10023 gids={3003}
I/ActivityThread( 3865): Publishing provider com.android.vending.SuggestionsProvider: com.android.vending.SuggestionsProvider
D/dalvikvm( 1030): GREF has increased to 701
I/vending ( 3865): com.android.vending.api.RadioHttpClient$1.handleMessage(): Handle DATA_STATE_CHANGED event: NetworkInfo: type: WIFI[], state: CONNECTED/CO
NNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
I/ActivityManager( 1030): Displayed activity com.android.vending/.AssetInfoActivity: 609 ms (total 7678 ms)
D/dalvikvm( 1030): GC freed 10458 objects / 676440 bytes in 128ms
I/MyApplication( 3858): [ Activity STOPPED ]
D/dalvikvm( 3865): GC freed 3538 objects / 254008 bytes in 84ms
W/dalvikvm( 3865): threadid=19: thread exiting with uncaught exception (group=0x4001b180)
E/AndroidRuntime( 3865): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception
E/AndroidRuntime( 3865): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime( 3865): at android.os.AsyncTask$3.done(AsyncTask.java:200)
E/AndroidRuntime( 3865): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime( 3865): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime( 3865): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime( 3865): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime( 3865): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
E/AndroidRuntime( 3865): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
E/AndroidRuntime( 3865): at java.lang.Thread.run(Thread.java:1096)
E/AndroidRuntime( 3865): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 3865): at com.android.vending.AssetItemAdapter$ReloadLocalAssetInformationTask.doInBackground(AssetItemAdapter.java:845)
E/AndroidRuntime( 3865): at com.android.vending.AssetItemAdapter$ReloadLocalAssetInformationTask.doInBackground(AssetItemAdapter.java:831)
E/AndroidRuntime( 3865): at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/AndroidRuntime( 3865): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime( 3865): ... 4 more
I/Process ( 1030): Sending signal. PID: 3865 SIG: 3
I/dalvikvm( 3865): threadid=7: reacting to signal 3
I/dalvikvm( 3865): Wrote stack trace to '/data/anr/traces.txt'
I/DumpStateReceiver( 1030): Added state dump to 1 crashes
D/AndroidRuntime( 3865): Shutting down VM
W/dalvikvm( 3865): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
E/AndroidRuntime( 3865): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 3865): java.lang.NullPointerException
E/AndroidRuntime( 3865): at com.android.vending.controller.AssetInfoActivityController.getIdDeferToLocal(AssetInfoActivityController.java:637)
E/AndroidRuntime( 3865): at com.android.vending.AssetInfoActivity.displayAssetInfo(AssetInfoActivity.java:556)
E/AndroidRuntime( 3865): at com.android.vending.AssetInfoActivity.access$800(AssetInfoActivity.java:74)
E/AndroidRuntime( 3865): at com.android.vending.AssetInfoActivity$LoadAssetInfoAction$1.run(AssetInfoActivity.java:917)
E/AndroidRuntime( 3865): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 3865): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 3865): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 3865): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 3865): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3865): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 3865): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 3865): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 3865): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 1030): Sending signal. PID: 3865 SIG: 3
W/ActivityManager( 1030): Process com.android.vending has crashed too many times: killing!
D/ActivityManager( 1030): Force finishing activity com.android.vending/.AssetInfoActivity
I/dalvikvm( 3865): threadid=7: reacting to signal 3
D/ActivityManager( 1030): Force removing process ProcessRecord{44e48548 3865:com.android.vending/10023} (com.android.vending/10023)
However, when I try to launch the market place for a package that exists in the market place say com.opera.mini.android, everything works. Log for this case:
D/dalvikvm( 966): GC freed 2781 objects / 195056 bytes in 99ms
I/MyApplication( 1165): Pressed OK button
I/MyApplication( 1165): Broadcasting Intent: android.intent.action.VIEW, data: market://details?id=com.opera.mini.android
I/ActivityManager( 78): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.opera.mini.android flg=0x10000000 cmp=com.android.vending/.AssetInfoActivity }
I/AndroidRuntime( 1165): AndroidRuntime onExit calling exit(0)
I/WindowManager( 78): WIN DEATH: Window{44c72308 myapp.testapp/myapp.testapp.MyApplication paused=true}
I/ActivityManager( 78): Process myapp.testapp (pid 1165) has died.
I/WindowManager( 78): WIN DEATH: Window{44c72958 myapp.testapp/myapp.testapp.MyApplication paused=false}
D/dalvikvm( 78): GC freed 31778 objects / 1796368 bytes in 142ms
I/ActivityManager( 78): Displayed activity com.android.vending/.AssetInfoActivity: 214 ms (total 22866 ms)
W/KeyCharacterMap( 978): No keyboard for id 65540
W/KeyCharacterMap( 978): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
V/RenderScript_jni( 966): surfaceCreated
V/RenderScript_jni( 966): surfaceChanged
V/RenderScript( 966): setSurface 480 762 0x573430
D/ViewFlipper( 966): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=true
D/dalvikvm( 978): GC freed 10065 objects / 624440 bytes in 95ms
Any ideas?
I am having similar problem when trying to open a detail page in Market app using "market://details?id=pname:org.rabold.android.puzzleblox" URL from an application.
I can create a shortcut using AnyCut like this:
action: android.intent.action.VIEW
data: market://details?id=pname:org.rabold.android.puzzleblox
type:
then it works fine.
However, if I create an Android application with a button to launch Market with the same Uri as above, then I get an error in Market app like this: "Attention: A server error has occurred. Retry, or cancel and return to the previous screen."
The code of my button's listener looks like this:
okButton = (Button) findViewById(R.id.okButton);
okButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=pname:org.rabold.android.puzzleblox"));
//Uri.parse("market://search?q=pname:org.rabold.android.puzzleblox"));
startActivity(intent);
}
});
Note in the above code, if I use 'search' instead of 'details' then it works. I'd like to use 'details' instead of 'search' because I know that my app will be available on Market when it's done. Thanks.
Update!:
Do not use "pname:"
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.example.android"));
startActivity(intent);
Works perfectly.
per:
http://developer.android.com/distribute/googleplay/promote/linking.html#android-app
☮ ♥ ☺
thnx Daniel, I can confirm that your solution is working fine on device.
#TPham: please try with correct url (append id only),
passing correct id also working fine, see example below;
static final String APP_MARKET_URL = "market://details?id=com.wareninja.android.fotolicke";
Intent intent = new Intent( Intent.ACTION_VIEW,
Uri.parse(APP_MARKET_URL));
startActivity(intent);
instead of launching with the exact ID, you can try doing it by searching by the package.
Intent intent = new Intent( Intent.ACTION_VIEW,
Uri.parse("market://search?q=pname:com.package.package2.package3"));
startActivity(intent);