【发布时间】:2014-09-29 09:45:26
【问题描述】:
我正在开发一个 phonegap、jquerymobile HTML5 应用程序。
我收到以下错误:“在没有当前上下文的情况下调用 OpenGL ES API(每个线程记录一次)” 我找到了类似问题的解决方案,但对我没有任何帮助。
我不明白为什么会出现这个错误,但是当我在 html 上调用一个新页面时,我观察到这个错误会发生。 我的 html 代码与此示例中的代码类似: http://www.w3schools.com/jquerymobile/tryit.asp?filename=tryjqmob_pages
我正在使用 eclipse 和 Android SDK Emulator。
Phonegap Android 的入门指南中提到了我的 Activity 类。这是我的活动课程:
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import org.apache.cordova.*;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty("loadUrlTimeoutValue", 60000);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
【问题讨论】:
-
它有什么影响吗?我不知道解决方案,但我有时也会继续得到它,但它从未受到伤害!
-
目前,它不会影响任何事情。不过不知道以后会不会有影响。
-
好的,这个错误不是
cordova特有的(我不知道它是什么)。一个简单的谷歌搜索会告诉你很多人在android中遇到同样的问题。您可能想查看这些帖子。 -
@AbhishekBansal 它是否似乎会影响某些东西是无关紧要的。不会无缘无故抛出警告/错误。仅仅因为你不认为它会伤害某些东西,并不意味着它不会或不会。
-
@b1nary.atr0phy 是的,我完全理解。我只是想说这是一个常见问题!