Android Forwarding Sample don't work

by evo » Mon, 13 Apr 2009 12:13:38 GMT


Sponsored Links
 Hi,
I had try some simply code on android. but when run on emulator. the
1st pages are fine, when click the button to second pages. it pop up
error "Sorry - The application Pages (process com.Pages) has stop
unexpectedly"

here the code:[Pages.java]

package com.Pages;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Pages extends Activity
{
    @Override
        protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        // Watch for button clicks.
        Button goButton = (Button)findViewById(R.id.go);
        goButton.setOnClickListener(mGoListener);
    }

    private OnClickListener mGoListener = new OnClickListener()
    {
        public void onClick(View v)
        {
            Intent intent = new Intent();
            intent.setClass(Pages.this, loli.class);
            startActivity(intent);
        }
    };
}

an next pages code[loli.java]:
package com.Pages;

import android.app.Activity;
import android.os.Bundle;


/**
 * Example of removing yourself from the history stack after
forwarding to
 * another activity.
 */
public class loli extends Activity
{
    @Override
        protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.loli);
    }
}

I did't find any error on the code, is there any mistake done by me?

--~--~---------~--~----~------------~-------~--~----~



Android Forwarding Sample don't work

by Ralf » Mon, 13 Apr 2009 14:06:09 GMT


 Could you look at the logcat output (Eclipse > Windows > Perspective >
DDMS) or "adb logcat" from a shell? There should be a strack trace
that will tell you exactly what crashed.

For example, are you sure that the findViewById does not return null?
R/




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Android Forwarding Sample don't work

by zooFun » Tue, 14 Apr 2009 01:00:00 GMT


 Did you add your loli Activity into the AndroidManifest.xml?





--~--~---------~--~----~------------~-------~--~----~



Android Forwarding Sample don't work

by zhoubo shi » Tue, 14 Apr 2009 10:30:38 GMT


 You can debug your code step by step, Maybe you can find out why.

2009/4/13 zooFun <zhufengz...@gmail.com>




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Signature issues preventing device from fully booting up

Hi-
We are working on a Donuts based device, and have run into a 100%
random case.  We experience this when doing an SD upgrade from one
production build to another.  (Our production builds, have choosecombo
set to "user" and not "eng".)  It also seems to happen when a device
wipe is NOT done during the upgrade process.

Basically PowerManagerService crashes as follows:

E/6 ActivityThread( 4755): Failed to find provider info for settings
W/6 dalvikvm( 4755): threadid=55: thread exiting with uncaught
exception (group=0x2aac5de8)
E/6 AndroidRuntime( 4755): Uncaught handler: thread
PowerManagerService exiting due to uncaught exception
E/6 AndroidRuntime( 4755): *** EXCEPTION IN SYSTEM PROCESS.  System
will crash.
E/6 AndroidRuntime( 4755): java.lang.NullPointerException
E/6 AndroidRuntime( 4755):      at
android.content.ContentQueryMap.<init>(ContentQueryMap.java:65)
E/6 AndroidRuntime( 4755):      at
com.android.server.PowerManagerService.initInThread(PowerManagerService.java:
443)
E/6 AndroidRuntime( 4755):      at
com.android.server.PowerManagerService
$1.onLooperPrepared(PowerManagerService.java:403)
E/6 AndroidRuntime( 4755):      at
android.os.HandlerThread.run(HandlerThread.java:59)
E/6 AndroidRuntime( 4755): Crash logging skipped, no checkin service
E/806 dun_service( 1077): The value returned from
dun_getusbmodemstate_fromsys is 2
E/806 dun_service( 1077): The value returned from
dun_getusbmodemstate_fromsys is 2
E/788 installd( 1071): eof
E/788 installd( 1071): failed to read size

The very first line, where it is not able to find the provider for
settings caused me to look further up the log, where I find:

E/4 PackageManager( 4755): Package com.android.providers.settings has
no signatures that match those in shared user android.uid.system;
ignoring!

I feel the above is the cause for the crash.

It looks like it is unable to find the  platform cert with which
com.android.providers.settings is apparently signed.
1. Any clues as to why this might be happening?
2. Is there a keystore on the device where the certs are supposed to
be stored?  Where would I find that keystore?
3. I see a few posts on the web, where people have run into this
issue.  But do not see any conclusive solutions.
4. This does not happen when we fastboot the device from one prd build
to another (where the images are being used).

Any help would be most appreciated.

Thanks.
-karthik.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. binding to the search key

Hi, if i want to write an app (activity?) that gets called when the
user presses the search key whether or not my app is running, how do i
do that?

-- 

3. Cannot get versionName when it set with string reference

4. Disable keyboard in DatePicker ?

5. How to run background Activites in Android?

6. how to overcome "permission denied" error when SystemProperties.set

7. ListView refresh problem