Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.ycbjie.webviewlib.view.X5WebViewActivity闪退 #119

Open
Iridescentangle opened this issue Oct 11, 2021 · 0 comments
Open

com.ycbjie.webviewlib.view.X5WebViewActivity闪退 #119

Iridescentangle opened this issue Oct 11, 2021 · 0 comments

Comments

@Iridescentangle
Copy link

release版本:1.4.0

项目中将该Activity注册了Intent-Filter,所以应用接入后,会出现在浏览器应用列表里,

<intent-filter tools:ignore="AppLinkUrlError" >
    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <!-- 使用http,则只能打开http开头的网页 -->
    <data android:scheme="https" />
</intent-filter>

但是这个Activity中的WebProgress报了空指针

private void initFindViewById() {
      webView = findViewById(R.id.web_view);
      pb = findViewById(R.id.progress);
      tvTitle = findViewById(R.id.tv_title);
      mTitleToolBar = findViewById(R.id.title_tool_bar);
      //显示进度条
      pb.show();
      //设置进度条过度颜色
      pb.setColor(Color.BLUE,Color.RED);
      //设置单色进度条
      pb.setColor(Color.BLUE);
}
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ycbjie.webviewlib.widget.WebProgress.show()' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3611)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3775)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2246)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:233)
        at android.app.ActivityThread.main(ActivityThread.java:8010)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.ycbjie.webviewlib.widget.WebProgress.show()' on a null object reference
        at com.ycbjie.webviewlib.view.X5WebViewActivity.initFindViewById(X5WebViewActivity.java:129)
        at com.ycbjie.webviewlib.view.X5WebViewActivity.onCreate(X5WebViewActivity.java:115)
        at android.app.Activity.performCreate(Activity.java:8006)
        at android.app.Activity.performCreate(Activity.java:7990)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3584)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3775) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2246) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:233) 
        at android.app.ActivityThread.main(ActivityThread.java:8010) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant