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. repeating a set of animation sequentially

I have a set of 3 animations that I want to play sequentially, and have them
repeat.
I can put them in an AnimationSet, and use a startOffset to start them all
in the correct order - BUT they then each start repeating by their duration
setting - so they end up running simultaneously after the first play.
Is there any way to create a list of animations that when they repeat - it
repeats the list, not each individual animation?

-- 

2. aplikasi Al Quran di android

Hi all,
Saya Ihsan, baru gabung disini. Salam kenal semua.
Saat ini saya baru make SGT. Kalo aplikasi Al Quran (incl. terjemahan
bahasa Indonesia-syukur2 ada audionya juga) yang bagus apa ya? bisa di
share link buat ngedownloadnya dimana?
Thanks ya.
Salam.

-- 
===============
"

3. Tips dan Trik Mempercepat Akses Internet Menggunakan Opera Mini

4. [NexusOne] WTSha New Market in Blueish Theme

5. Database Remote Access

6. gingerbread alsa build issue

7. Drag and drop rearrange listview