We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Every time i use a listener, it gives the the NullPointer Exception. below is code extract
`final ArrayAdapter adapter = new ArrayAdapter(MainActivity.this, android.R.layout.simple_dropdown_item_1line, SPINNER_DATA); spinnerItem = (MaterialBetterSpinner)findViewById(R.id.choose_course); spinnerItem.setAdapter(adapter); spinnerItem.setOnItemClickListener(new AdapterView.OnItemClickListener() { @OverRide public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { item = adapterView.getItemAtPosition(i).toString(); Toast.makeText(adapterView.getContext(),item,Toast.LENGTH_SHORT).show(); Intent intent = new Intent(MainActivity.this, SemesterActivity.class); startActivity(intent);
} });
`
The text was updated successfully, but these errors were encountered:
Open class BetterSpinner, find method "onFocusChanged", change this code if (focused) to if (focused==true&&previouslyFocusedRect!=null), Done
if (focused)
if (focused==true&&previouslyFocusedRect!=null)
Sorry, something went wrong.
But BetterSpinner class is write protected class, then how do i change it?
Hi asif, Check my solution here: https://stackoverflow.com/questions/58370824/android-material-spinner-nullpointerexception-on-autocompletetextview/58371922#58371922
No branches or pull requests
Every time i use a listener, it gives the the NullPointer Exception. below is code extract
`final ArrayAdapter adapter = new ArrayAdapter(MainActivity.this, android.R.layout.simple_dropdown_item_1line, SPINNER_DATA);
spinnerItem = (MaterialBetterSpinner)findViewById(R.id.choose_course);
spinnerItem.setAdapter(adapter);
spinnerItem.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@OverRide
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
item = adapterView.getItemAtPosition(i).toString();
Toast.makeText(adapterView.getContext(),item,Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this, SemesterActivity.class);
startActivity(intent);
`
The text was updated successfully, but these errors were encountered: