My Application crash on resume
Closed this issue · 2 comments
pishguy commented
when i trying to use this library, i dont have any problem on opening application on first time, but after change permission on android setting and reopen paused application i get this error:
Caused by: java.lang.IllegalAccessException: void com.kishan.askpermission.ShadowFragment.<init>() is not accessible from java.lang.Class<android.app.Fragment>
My code:
public void onCreate(@Nullable Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= 21) {
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
}
super.onCreate(savedInstanceState);
context = getBaseContext();
alachiq = (Alachiq) getApplication();
handler = new Handler();
activity = ActivityRegister.this;
/** Set connection Listener */
setRealTimeConnectionListener(this);
binding = DataBindingUtil.setContentView(this, R.layout.activity_register);
ActivityRegisterPresenter presenter = new ActivityRegisterPresenter(this);
binding.setPresenter(presenter);
int hasPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS);
if (hasPermission == PackageManager.PERMISSION_GRANTED) {
attachFragmentsToRegisterUser();
}else{
new AskPermission.Builder(this).setPermissions(Manifest.permission.READ_CONTACTS,
Manifest.permission.READ_CONTACTS)
.setCallback(this)
.setErrorCallback(this)
.request(READ_CONTACTS);
}
}
Kishanjvaghela commented
@tux-world Which version you are using? Had you tried with latest one??
compile 'com.kishan.askpermission:askpermission:1.0.3'
pishguy commented
@Kishanjvaghela Thanks, please update main page of library