wood burning stoves 2.0*
The moose likes Android and the fly likes Why the program not run? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Why the program not run?" Watch "Why the program not run?" New topic
Author

Why the program not run?

fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
Hi
I write this code in Mian.java class but the program not run. Why? the program has error of Intent i=new Intent(this,Location.class); what is the problem??

The problem is : The constructor Intent(new View.OnClickListener(){}, Class<Location>) is undefined

Please help me fast ;)

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
An OnClickListener is not a Context - which is what the Intent constructor expects as the first parameter. You probably meant to pass in the Main instance instead.


Ping & DNS - my free Android networking tools app
fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 84
I want, when user clicks in places button, the program goes to another class and run location class. this code is false?

I change this to Main.this and program runs but when i clicked in Places, the program stop. Why? I write LogCat in below

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
That's a completely different question, please keep topics focused on a single question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why the program not run?