我有一个广播接收器,它在Android Applcation类的onCreate()方法中注册但是如何取消注册
例
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
registerReceiver(broadcastReceiver, new IntentFilter("TIMEZONE_CHANGED"));
}
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我在应用程序onCreate()方法中注册了它,并且Application类中没有onDestroy()/ onStop()方法来取消注册broadcastReceiver.
如何实现它
尝试在“文本”视图中渲染文本时出现以下错误
java.lang.RuntimeException: PARAGRAPH span must start at paragraph boundary (46 follows )
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:161)
at android.text.SpannableStringInternal.copySpans(SpannableStringInternal.java:67)
at android.text.SpannableStringInternal.<init>(SpannableStringInternal.java:42)
at android.text.SpannedString.<init>(SpannedString.java:30)
at android.text.method.ReplacementTransformationMethod.getTransformation(ReplacementTransformationMethod.java:83)
at android.widget.TextView.setText(TextView.java:4436)
at android.widget.TextView.setText(TextView.java:4332)
at android.widget.TextView.setText(TextView.java:4307)
Run Code Online (Sandbox Code Playgroud)
我打电话像
myAsyncTask().execute(source, listDrawable, textView.getContext());
return listDrawable;
}
}, new MyTagHandler());
textView.setText(htmlText);
Run Code Online (Sandbox Code Playgroud)
谁能帮我解决上述问题