help on Android

by Billsen » Fri, 27 Jun 2008 07:48:50 GMT

Sponsored Links

I am a new comer to Android and need a help. Here is my question? How
to get to a new activity by clicking a button.
What is what I did.

In class CompantMenu, I have code like this

 listButton.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {


public void listCompany(){
                Intent i = new Intent(this,ListCompany.class);

In class ListCompany, I have code like this,

 public void onCreate(Bundle icicle) {

Node:list_company.xml is availabe and classes ListCompany CompantMenu
are in AndroidManifest.xml.

When I lick listButton, I did not get page defined by list_company,
instead, I got java.long.NullPointerException.

How solve this issue?




help on Android

by Mark Murphy » Fri, 27 Jun 2008 08:20:38 GMT


You should probably look at the stack trace (e.g., via adb logcat) to 
see where exactly you got the exception. That may help you determine if 
the problem is with CompantMenu or with ListCompany and may give you a 
clue as to what pointer is null.

Mark Murphy (a Commons Guy) 
Warescription: All titles, revisions, & ebook formats, just $35/year


Sponsored Links

help on Android

by Juven Xu » Fri, 27 Jun 2008 11:56:11 GMT

 please paste the stack trace to help figure out the root cause


Other Threads

1. please help me to do this task

hai all i am a new bie of this android...

can any one please help me to get over this task

my task is simple that

           i hav the database of some questions and i retrieved and
shown in emulator when i clicked that page it should read the data
(means hears the pronounciation of the words which are present there
on the emulator screen).

         can any one provide the login screen code with out the xml
file that means i dont want the UI frm the xml file i would like to go
with the java code so can any one provided this would be appreciable
and Thanks

the login validation should be these words
the username :  google
password : google


2. how do you post to this group

I'm sorry.  I asked a question about buttons containing only text a
few days ago and it has yet to show up in the group.

How do you post a question?



3. scaling a web-page in a WebView element

4. Problem with Timer and ImageView (with setImageResource)

5. surfaceCreated() and CreateSurface() in camera preview application

6. Recording direct system audio??

7. Low level audio really needed - too much latency in SoundPool, AudioTrack for more real time stuff