2

When I try to make a make an Android app with GreenDroid, so I put the code in there but it asks for a ; while there already is one.

as people asked for the whole code hereby the whole code!

import greendroid.app.GDApplication;
import android.content.Intent;
import android.net.Uri;

public class GreenDroidTest extends GDApplication {

@Override
public Class<?> getHomeActivityClass() {
    return GreenDroidTest.class;
}

@Override
public Intent getMainApplicationIntent() {
return new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_url)));
    }

 }

And I can't find any solutions. I already tried Cleaning and building the workspace.

TheCad
  • 47
  • 1
  • 1
  • 9

1 Answers1

2

Cut some of that nesting up into multiple lines. That way you can get better visibility as to the location the compiler is complaining about. For example

1 @Override
2 public Intent getMainApplicationIntent() {
3     return new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_url)));
4 }

might tell you a semicolon is needed at line 3, but

1  @Override
2  public Intent getMainApplicationIntent() {
3      return new Intent(
4          Intent.ACTION_VIEW, 
5          Uri.parse(
6              getString(
7                  R.string.app_url
8              )
9          )
10     );
11 }

might tell you a semicolon is needed at line 8.

After you have identified where the semicolon is needed, you can happily put the line back together, with a semicolon in the "right" spot.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
  • I am able to copy the code above without compilererrors. I dont think that method is the reason for the message... – nano_nano Aug 27 '12 at 14:56
  • then look to the code outside of the method, perhaps this is overriding an anonymous object (an object that has no sub-type, but directly overrides abstracts), and the outside constructor block lacks a required terminating semicolon. In any event, keep a close eye on line numbers, and expand if necessary should the line have too many options for semicolon placement. – Edwin Buck Aug 27 '12 at 15:02
  • @BC_ Is it possible to use getString(); without Extending Activity Class? – Mohit Aug 27 '12 at 15:21
  • @EdwinBuck Thank you for that sollution,i trieded it and while trying it solved it self so i don't know why it did that but still, Thank you – TheCad Aug 27 '12 at 15:23