0
다음은창을 추가 할 수 없습니다 - 토큰 android.os.BinderProxy
private void displayInternetAlert(final Context context) {
if (!((GlobalActivity) context).isFinishing() && context instanceof GlobalActivity) {
((GlobalActivity) context).runOnUiThread(new Runnable() {
@Override
public void run() {
if (Validator.isNull(internetDialog)) {
internetDialog = new AlertDialog.Builder(Util.createCustomAlertDialog(context)).create();
internetDialog.setMessage(context.getString(R.string.internet_disable));
internetDialog.setButton(DialogInterface.BUTTON_NEUTRAL, context.getString(R.string.settings), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
/*
Don't need to write onactivity result now as we try to connect every time
*/
context.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
dialog.dismiss();
}
});
internetDialog.setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.ignore), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
internetDialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
internetDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(context.getResources().getColor(R.color.dialog_cancel_button));
internetDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setTypeface(null, Typeface.BOLD);
internetDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(context.getResources().getColor(R.color.dialog_cancel_button));
}
});
}
if (!internetDialog.isShowing()) {
internetDialog.show();
}
}
});
}
}
아래가되는 내 GlobalActivity 클래스
public class GlobalActivity extends AppCompatActivity {
@Nullable
@Bind(R.id.adView)
public AdView adView;
public GlobalActivity() {
ExceptionHandler.getExceptionHandler().setActivity(this);
}
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
setContentView(R.layout.ad_system);
ButterKnife.bind(this);
}
@Override
protected void finalize() throws Throwable {
}
@Override
protected void onStart() {
super.onStart();
loadGoogleAdd();
}
@Override
protected void onResume() {
super.onResume();
if(Validator.isNotNull(adView)){
adView.resume();
}
}
@Override
protected void onPause() {
super.onPause();
if(Validator.isNotNull(adView)){
adView.pause();
}
Util.setSharedPreferences(this, Util.SHARED_PREFERENCE_PREFERENCES, Util.EXPOSE_GSON.toJson(Util.getPreferences(this)));
}
private void loadGoogleAdd() {
if (adView != null) {
AdRequest adRequest = new AdRequest.Builder().
addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
adView.loadAd(adRequest);
}
}
public void loadErrorActivity() {
startActivity(new Intent(GlobalActivity.this, ErrorActivity.class));
}
@Override
protected void onDestroy() {
super.onDestroy();
if(Validator.isNotNull(adView)){
adView.destroy();
}
Request.getRequest().dismissProgressDialog(this);
}
}
내 응용 프로그램에서 경고 대화 상자를 표시하기위한 내 유틸리티 방법 I 모든 활동을 연장하고 그 활동에서 내가 끝내는 활동을 확인 했음에도 불구하고 나는 조각을 대체하고있다.
하지만 여전히 SM-G935F (Samesung Galaxy s7 edge)에서이 예외가 발생합니다. appcompat 23.1.1을 사용하고 있습니다. 그것은 플랫폼 또는 장치 특정 문제 또는 내가 실수를하고 있는지 여부에 대한 해결책을 찾는 데 도움주세요.
도움이 필요합니다.
을 이미 runonui 스레드를 사용하고 –