Last active
October 18, 2017 13:36
-
-
Save marinat/202835aafbabee59df80efaeda72a80b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10-18 16:30:36.502 4333-4333/com.nokl.androidclient E/AndroidRuntime: FATAL EXCEPTION: main | |
Process: com.nokl.androidclient, PID: 4333 | |
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.nokl.androidclient.credential.login.LPresenter.ok()' on a null object reference | |
at com.nokl.androidclient.credential.login.LoginFragment.onCreateView(LoginFragment.java:104) | |
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192) | |
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299) | |
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) | |
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.arellomobile.mvp.MvpView; | |
/** | |
* Created by ultra on 18.10.2017. | |
*/ | |
public interface HelloView extends MvpView { | |
void setok(boolean ok); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginFragment extends MvpAppCompatFragment implements HelloView { | |
@InjectPresenter | |
LPresenter mPresenter; | |
boolean ok = false; | |
@Nullable | |
@Override | |
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.login, container, false); | |
mPresenter.ok(); //Здесь ошибка | |
......................... | |
} | |
@Override | |
public void setok(boolean ok) { | |
this.ok = ok; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.arellomobile.mvp.InjectViewState; | |
import com.arellomobile.mvp.MvpPresenter; | |
/** | |
* Created by ultra on 18.10.2017. | |
*/ | |
@InjectViewState | |
public class LPresenter extends MvpPresenter<HelloView> { | |
public LPresenter() { | |
getViewState().setok(true); | |
} | |
boolean ok = false; | |
void ok() { | |
ok = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment