嗨所以在我们的项目中我们使用书法库,它没有任何问题,但现在在我添加的其中一个活动中,它与以下堆栈跟踪一起崩溃:
01-23 02:25:32.178 3654-3654/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example, PID: 3654
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activities.MultipleActivity}: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:621)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:690)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) …
Run Code Online (Sandbox Code Playgroud) 你好.我是一个Android初学者,试图创建一个可以过滤多个动作的IntentFilter.不幸的是,当我开始使用该addAction
方法时,Eclipse会抛出一个错误:
"令牌"addAction"上的语法错误,此标记后的标识符"
即使我已导入所需的文件.这可能是一个设置问题,即使我不确定为什么其余的代码没有显示任何问题.
这是我的代码存根:
import android.content.Intent;
import android.content.Context;
import android.content.IntentFilter;
...
private Context mContext;
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.SCREEN_OFF");
Run Code Online (Sandbox Code Playgroud)
我还观察了一件事 - 我输入'过滤器'.没有显示,只有消息"没有默认提案"
有谁能够帮我?