在本文中,我们将详细介绍在Eclipse连接Android设备之后debugging视图中的NullPointerException的各个方面,并为您提供关于eclipse连接derby的相关解答,同
在本文中,我们将详细介绍在Eclipse连接Android设备之后debugging视图中的NullPointerException的各个方面,并为您提供关于eclipse连接derby的相关解答,同时,我们也将为您带来关于Android ActionBar NullPointerException、Android Library项目说nullpointerexception、Android OS 3.2上的WindowManagerImpl中的NullPointerException、android – BoringLayout.isBoring中的NullPointerException是无聊的的有用知识。
本文目录一览:- 在Eclipse连接Android设备之后debugging视图中的NullPointerException(eclipse连接derby)
- Android ActionBar NullPointerException
- Android Library项目说nullpointerexception
- Android OS 3.2上的WindowManagerImpl中的NullPointerException
- android – BoringLayout.isBoring中的NullPointerException是无聊的
在Eclipse连接Android设备之后debugging视图中的NullPointerException(eclipse连接derby)
我在Fedora 16 OS上运行Eclipse,遇到一些奇怪的问题。 一切运作良好,直到我不selectdebugging视图。 之后,如果任何Android设备连接Eclipse就卡住了。 我从terminal启动了Eclipse,发现这个exception发生在卡住之前:
Exception in thread "LogCat output receiver for ????????????" java.lang.NullPointerException at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:100) at java.lang.Thread.run(Thread.java:722)
是否有任何想法如何处理?
更新 :看起来我遇到了这个问题: http : //code.google.com/p/android/issues/detail?id=34945 。
如何在AWS服务器(Windows)中运行Android模拟器? 因为它不支持加速模式
如何在Android Things应用程序上安装USB驱动器?
无法从同一局域网内的远程机器访问Android设备
使用adbshell连接到wi-fi
grep完全匹配
Android回购初始化失败
如何获得android cpu模型名称?
与PC所需的MTP连接,但它是独立于设备?
切换时崩溃活动
Yakkety Yak的Android模拟器(Ubuntu 16.10)
这是一个在Eclipse中的bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=384315#c11它已经修复了上次更新
总结
以上是小编为你收集整理的在Eclipse连接Android设备之后debugging视图中的NullPointerException全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
Android ActionBar NullPointerException
这是我的MainActivity:
public void onCreate(Bundle savedInstanceState) { this.requestwindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.login); ActionBar actionBar = getActionBar(); actionBar.show(); //more code............
这是logcat:
03-04 16:31:09.423: E/AndroidRuntime(1441): FATAL EXCEPTION: main 03-04 16:31:09.423: E/AndroidRuntime(1441): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.salebook/com.example.salebook.MainActivity}: java.lang.NullPointerException 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2180) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread.access$600(ActivityThread.java:141) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.os.Handler.dispatchMessage(Handler.java:99) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.os.Looper.loop(Looper.java:137) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread.main(ActivityThread.java:5041) 03-04 16:31:09.423: E/AndroidRuntime(1441): at java.lang.reflect.Method.invokeNative(Native Method) 03-04 16:31:09.423: E/AndroidRuntime(1441): at java.lang.reflect.Method.invoke(Method.java:511) 03-04 16:31:09.423: E/AndroidRuntime(1441): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 03-04 16:31:09.423: E/AndroidRuntime(1441): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 03-04 16:31:09.423: E/AndroidRuntime(1441): at dalvik.system.NativeStart.main(Native Method) 03-04 16:31:09.423: E/AndroidRuntime(1441): Caused by: java.lang.NullPointerException 03-04 16:31:09.423: E/AndroidRuntime(1441): at com.example.salebook.MainActivity.onCreate(MainActivity.java:130) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.Activity.performCreate(Activity.java:5104) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 03-04 16:31:09.423: E/AndroidRuntime(1441): at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2144) 03-04 16:31:09.423: E/AndroidRuntime(1441): ... 11 more
第130行是anctionBar.show(),我在res / menu / menu.xml中:
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/itemid_0" android:title="Action Item 0" android:icon="@drawable/ic_launcher" android:orderInCategory="0" android:showAsAction="ifRoom|withText" /> <item android:id="@+id/itemid_1" android:title="Action Item 1" android:orderInCategory="0" /> <item android:id="@+id/itemid_2" android:title="Action Item 2" android:orderInCategory="0" /> <item android:id="@+id/itemid_3" android:title="Action Item 3" android:orderInCategory="0" /> </menu>
我没有发现问题.希望有人帮助我.
谢谢.
另外,在appThem风格:
<style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowActionBar">true</item> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style>
解决方法
确保您具有显示操作栏的窗口功能,这是操作栏显示所必需的.有关详细信息,请查看以下链接.
…检查此问题getActionBar returns null并查看此链接以获取有关您的问题http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html的更多信息
Android Library项目说nullpointerexception
我有一个android库项目my_lib基本上my_lib有list活动说MyListActivity它有资源和东西.当我运行Android应用程序’MyListActivity’工作正常.
但是当我创建另一个proj说test_proj并将my_lib作为android库项目添加到test_proj作为库并在AndroidManifest中添加MyListActivity活动并运行我在MyListActivity中得到NullPoiterException,即在findViewById(R.id.list)返回null.我怎样才能解决这个问题
代码如下
onCreate of MyListActivity
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestwindowFeature(Window.FEATURE_NO_TITLE);
getwindow().addFlags(LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setContentView(R.layout.activity_main);
initData();
rowItems = new ArrayList<RowItem>();
for (int i = 0; i < titles.length; i++) {
RowItem item = new RowItem(images[i], titles[i], descriptions[i], packageNames[i]);
rowItems.add(item);
}
listView = (ListView) findViewById(R.id.list);
CustomListViewAdapter adapter = new CustomListViewAdapter(this, R.layout.list_item, rowItems);
listView.setAdapter(adapter);
listView.setonItemClickListener(this);
}
onCreate of MainActivity of test proj
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startActivity(new Intent(this, ImageTextListViewActivity.class));
}
错误日志如下
D/AndroidRuntime( 778): Shutting down VM
E/AndroidRuntime( 778): FATAL EXCEPTION: main
E/AndroidRuntime( 778): java.lang.NoSuchFieldError: com.mass.applist.R$id.list
E/AndroidRuntime( 778): at com.mass.applist.MyListActivity.onCreate(MyListActivity.java:55)
E/AndroidRuntime( 778): at android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 778): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 778): at android.app.ActivityThread.performlaunchActivity(ActivityThread.java:2144)
E/AndroidRuntime( 778): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 778): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime( 778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime( 778): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 778): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 778): at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime( 778): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 778): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 778): at dalvik.system.NativeStart.main(Native Method)
解决方法:
的setContentView(R.layout.activity_main);
确保lib中的布局和您的示例活动没有相同的名称.
Android OS 3.2上的WindowManagerImpl中的NullPointerException
例外是:
FATAL EXCEPTION: main java.lang.NullPointerException at android.view.WindowManagerImpl.reportNewConfiguration(WindowManagerImpl.java:427) at android.app.ActivityThread.handleUpdatePackageCompatibilityInfo(ActivityThread.java:2801) at android.app.ActivityThread.access$2700(ActivityThread.java:122) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:132) at android.app.ActivityThread.main(ActivityThread.java:4123) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:491) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) at dalvik.system.NativeStart.main(Native Method)
我的测试代码:
TestActivity.java(由Wizerd生成)
package com.test; import android.app.Activity; public class TestActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = new Intent(this,TestService.class); startService(intent); } }
TestService.java(大多数函数都是空的)
Package com.test; import android.content.ComponentName; public class TestService extends Service { private boolean m_connected = false; private ServiceConnection m_connInitService = new ServiceConnection() { public void onServiceConnection(ComponentName className,IBinder service) { m_connected = true; } public void onServicedisconnected(ComponentName className) { } }; public static class TestServiceBinder extends Binder { } public IBinder onBind(Intent intent) { return new TestServiceBinder(); } public void onDestroy() { super.onDestroy(); } public int onStartCommand(Intent intent,int flags,int startId) { return 1; } }
如果我在同一过程中没有服务或服务运行测试应用程序,屏幕兼容性开关将不会导致任何问题.但是,我不明白为什么服务会在屏幕兼容性切换期间导致系统异常.这是因为服务流程是非UI流程吗?哪个可能会触发Android核心代码中的错误?
解决方法
android:process
If the name assigned to this attribute begins with a colon (‘:’),a
new process,private to the application,is created when it’s needed
and the service runs in that process. If the process name begins with
a lowercase character,the service will run in a global process of
that name,provided that it has permission to do so. This allows
components in different applications to share a process,reducing
resource usage.
因此,如果您指定以小写字母开头的进程名称,则应具有执行此操作的权限.但我不知道检查这些权限的位置.也许它们在WindowManagerImpl中被检查,它找不到这个全局进程,因此返回null.这只是一个假设.
android – BoringLayout.isBoring中的NullPointerException是无聊的
通常不会发生,但会发生在一些用户身边.
在Android 2.3.3上,BoringLayout.isBoring:240发生异常
在Android 4.1.2上相同,第260行
任何帮助,将不胜感激.
总结
以上是小编为你收集整理的android – BoringLayout.isBoring中的NullPointerException是无聊的全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
今天关于在Eclipse连接Android设备之后debugging视图中的NullPointerException和eclipse连接derby的分享就到这里,希望大家有所收获,若想了解更多关于Android ActionBar NullPointerException、Android Library项目说nullpointerexception、Android OS 3.2上的WindowManagerImpl中的NullPointerException、android – BoringLayout.isBoring中的NullPointerException是无聊的等相关知识,可以在本站进行查询。
本文标签: