aspose file tools
The moose likes Android and the fly likes Why the program not run? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Mobile » Android
Reply 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: 56
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: 35443
    
    9
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.


Android appsImageJ pluginsJava web charts
fahimeh hashemian
Ranch Hand

Joined: Aug 07, 2012
Posts: 56
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: 35443
    
    9
That's a completely different question, please keep topics focused on a single question.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Why the program not run?
 
Similar Threads
Problem with creating a simple Menu in Browser view.
Cannot find the problem in the code
getting real path from an image uri after camera and uploading-getting null pointer exception
ftp uploads but only the second time a picture is taken?
public void onClick(View v) { // error