android loading spinner code example
Example 1: spinner android
Spinner spinner = (Spinner) findViewById(R.id.spinner);
spinner.setOnItemSelectedListener(this);
List<String> categories = new ArrayList<String>();
categories.add("Automobile");
categories.add("Business Services");
categories.add("Computers");
categories.add("Education");
categories.add("Personal");
categories.add("Travel");
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categories);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(dataAdapter);
Example 2: loading android studio
import android.os.Handler;
Runnable runnable = new Runnable() {
@Override
public void run() {
Intent intent = new Intent(getApplicationContext(), inscription.class);
startActivity(intent);
finish();
}
};
new Handler().postDelayed(runnable,3000);
}