小编Sou*_*asu的帖子

无法解析Activity的超类

我在基于OpenGL ES 10的新项目中收到此错误:

  09-03 12:44:07.870: W/dalvikvm(599): Unable to resolve superclass of Lcom/example/basicgl10test/MainActivity; (416)
  09-03 12:44:07.870: W/dalvikvm(599): Link of class 'Lcom/example/basicgl10test/MainActivity;' failed
  09-03 12:44:07.870: D/AndroidRuntime(599): Shutting down VM
  09-03 12:44:07.910: W/dalvikvm(599): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
  09-03 12:44:07.920: I/dalvikvm(599): Wrote stack traces to '/data/anr/traces.txt'
  09-03 12:44:07.980: E/AndroidRuntime(599): FATAL EXCEPTION: main
  09-03 12:44:07.980: E/AndroidRuntime(599): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.basicgl10test/com.example.basicgl10test.MainActivity}: java.lang.ClassNotFoundException: com.example.basicgl10test.MainActivity
  09-03 12:44:07.980: E/AndroidRuntime(599):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
  09-03 12:44:07.980: E/AndroidRuntime(599):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  09-03 12:44:07.980: E/AndroidRuntime(599):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
  09-03 12:44:07.980: E/AndroidRuntime(599): …
Run Code Online (Sandbox Code Playgroud)

android android-activity

11
推荐指数
2
解决办法
1万
查看次数

WP7中的Intent等价物

WP7中是否有与Android Intents相同的概念?

基本上,我想使用我的应用程序与另一个应用程序交互(如果安装在设备上).

谢谢Souvik

android android-intent windows-phone-7

3
推荐指数
1
解决办法
821
查看次数

声明InputStream

我正在学习android和Java新手,但不是编程新手(使用Eclipse).我试图在一个方法中执行这样的示例代码:

private void dummy() {
    try {
        URL url = new URL(quakeFeed);
        URLConnection connection;
        connection = url.openConnection();
        HttpURLConnection httpconnection = (HttpURLConnection)connection;
        int responseCode = httpconnection.getResponseCode();
        if(responseCode == HttpURLConnection.HTTP_OK)
            InputStream inp = new BufferedInputStream(httpconnection.getInputStream());
    }
...
}
Run Code Online (Sandbox Code Playgroud)

假设定义了所有其他语法和变量.我收到以下错误:

无法将InputStream`解析为变量.

即使在导入后这也很奇怪 java.io.InputStream;

如果我InputStream在方法之外声明,即错误就会消失

InputStream inp;
private void dummy() {
    try {
        URL url = new URL(quakeFeed);
        URLConnection connection;
        connection = url.openConnection();
        HttpURLConnection httpconnection = (HttpURLConnection)connection;
        int responseCode = httpconnection.getResponseCode();
        if(responseCode == HttpURLConnection.HTTP_OK)
        // Changed
            inp = new BufferedInputStream(httpconnection.getInputStream());
    }
    ... …
Run Code Online (Sandbox Code Playgroud)

java android

2
推荐指数
1
解决办法
8593
查看次数

LibGdx:在应用程序生命周期中调用两次Resize

我有一个代码,我得到这些输出.我使用libgdx框架,似乎自应用程序启动以来调用了两次resize.想知道为什么它被称为两次,因为我没有做任何不寻常的事情.下面的类是从实现Screen类的AbstractScreen扩展而来的.应用程序LifeCycle的链接:http://code.google.com/p/libgdx/wiki/ApplicationLifeCycle

The tags refer to the Functions being called:

SHOW(): devInfo.glyphWidth=18
SHOW(): devInfo.glyphHeight=27
AbstractScreen.resize: screenScaleX=0.8
AbstractScreen.resize: screenScaleY=0.8
resize(): devInfo.glyphWidth=14
resize(): devInfo.glyphHeight=21
resize(): logoSplashSprite.getWidth=204.8
resize(): logoSplashSprite.getHeight=204.8
AbstractScreen.resize: screenScaleX=0.8
AbstractScreen.resize: screenScaleY=0.8
resize(): devInfo.glyphWidth=11
resize(): devInfo.glyphHeight=16
resize(): logoSplashSprite.getWidth=204.8
resize(): logoSplashSprite.getHeight=204.8
fps 0
fps 65
.
.
.
Run Code Online (Sandbox Code Playgroud)

谢谢Souvik

android libgdx

1
推荐指数
1
解决办法
865
查看次数