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. How to monitor android application memory leak? is there tools do it?

I want to find my android application whether has memory leak  . and
some tool help me do i

-- 

2. some autoLink links not clickable

I have a TextView that I am setting some text. I have the
autoLink="true" attribute set in XML, and some links don't seem to be
clickable, while others are.

So far, from what I can tell, the links that work are simple domain
links like http://www.example.com, while the links that don't work are
generally ones with trailing paths (namely bit.ly type links),
http://bit.ly/202hslshds

Has anyone encountered this issue before? Why would some links be
clickable and others not, even though they do get properly styled?

I've searched this group and google and have not found any reasonable
explanation. I have tried setting the MovementMethod, setting the
TextView's linksClickable XML, as well as calling that in java.

What makes this even stranger is that the links seem to be more (if
not all) clickable when I flip the phone to landscape.

I'm on the verge of splitting the TextView into a horizontal
LinearLayout of TextViews and assigning onClick handlers to each
clickable piece, but that seems like an aweful lot of work for
something that seems like it should just work. Anybody else have
issues/solutions on this?

-- 

3. Listview highlight on touch doesn't show?

4. Any tried 'PhoneUsage' application

5. How to Play YouTube videos in our Android Application?

6. [OOT] jutaan orang menggunakan Android di Indonesia

7. phone to chrome