java 语法错误,插入“;” 完成 BlockStatements GreenDroid
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12144206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Syntax error, insert ";" to complete BlockStatements GreenDroid
提问by TheCad
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.
当我尝试使用 GreenDroid 制作一个 Android 应用程序时,我将代码放在那里,但它要求一段;
时间已经有了一个。
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.
我找不到任何解决方案。我已经尝试过清理和构建工作区。
采纳答案by Edwin Buck
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
可能会告诉您第 3 行需要一个分号,但是
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.
可能会告诉您第 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.
在确定需要分号的位置后,您可以愉快地将行重新组合在一起,并在“正确”的位置使用分号。