[Solved] The best way to use variables in another activity [closed]

[ad_1] If you start a new activity u can send data with an intent. For example: Intent intent = new Intent(this, newActivity.class); intent.putExtra(KEY, data); If the data is custom object this class must extends from Parcelable so it could be send with an Intent. [ad_2] solved The best way to use variables in another activity … Read more

[Solved] Intent throwing error in click listener in Android Studio

[ad_1] Problem is you are setting wrong layout in your UserLogin Activity. You are setting activity_main.xml instead you need to set your UserLogin Activity layout XML file . You are doing like this setContentView(R.layout.activity_main); Instead you need to do like setContentView(R.layout.YOUR_USER_LOGIN_ACTIVITY_LAYOUT); 8 [ad_2] solved Intent throwing error in click listener in Android Studio

[Solved] Integer cannot be cast to java.util.HashMap

[ad_1] this is previous code on my custom adapter: @Override public Object getItem(int position) { // TODO Auto-generated method stub return (position); } and this is solved code in my custom adapter: @Override public Object getItem(int position) { // TODO Auto-generated method stub return data.get(position); } in which datais defined as ArrayList<HashMap<String, String>> data; [ad_2] … Read more