[Solved] Button a button unclickabale in Android

Suppose you have five question. when he reached the last question. He definetly submit or click next. on that just pass a boolean variable in Intent if it is in an other Activity. Intent intent = new Intent(CurrentActivity.this,Destination.class); intent.putExtra(“flag”,true/False); startActivity(intent); getting intent in another activity.. boolean flag = getIntent.getExtra().getBoolean(“flag”); if(flag) // button.setEnabled(false); else // do … Read more

[Solved] Background color change (every second a slight change) [closed]

This May Help You ValueAnimator colorAnim = ObjectAnimator.ofInt(**myView**, “backgroundColor”, Color.RED, Color.BLUE); colorAnim.setDuration(3000); colorAnim.setEvaluator(new ArgbEvaluator()); colorAnim.setRepeatCount(ValueAnimator.INFINITE); colorAnim.setRepeatMode(ValueAnimator.REVERSE); colorAnim.start(); Where myView is the view on which you want to apply Animation 2 solved Background color change (every second a slight change) [closed]

[Solved] How to open an Image from on Itemclick listener

Your error itself gives answer of your question. requestFeature() must be called before adding content That means your second Activity needs this change requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main4); requestWindowFeature() must be before setContentView() After your updated question now your error is java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)’ on a null object reference you need to check … Read more

[Solved] Android Studio: Cannot resolve symbol ‘activity_profile’

Introduction This article provides a solution to the error “Cannot resolve symbol ‘activity_profile’” in Android Studio. This error occurs when the activity_profile.xml file is not found in the project. The article explains the steps to resolve this issue and get the project running again. It also provides some tips to avoid this issue in the … Read more

[Solved] Newbie here! How to create a detail page activity for a list view item, without including an action bar in it? Help required

I solved my problem in 3 steps: For creating detail activity page I used an adapter class to fetch all the data from server FOr no ActionBar I made a custom action bar, set it to transparent, changed my app theme by calling a Parent theme and then modified for primary, primary Dark and accent … Read more

[Solved] No Activity found when navigating to another activity in Android

try this, btnAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Start 2nd Activity if(selectedItem != 0){ insertContact(name, email); } startActivity(new Intent(MainActivity.this, SecondActivity.class)); finish() } }); 5 solved No Activity found when navigating to another activity in Android

[Solved] error: cannot find symbol method setContentView(int) [duplicate]

In fragment you inflate the layout not setContentView the code maybe look like this @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment1_layout, container, false); // Put your fragment code here return rootView; } 9 solved error: cannot find symbol method setContentView(int) [duplicate]

[Solved] ActivityNotFoundException: Unable to find explicit activity class {co.edu.unimagdalena.projecto/co.edu.unimagdalena.projecto.informacion2}

ActivityNotFoundException: Unable to find explicit activity class {co.edu.unimagdalena.projecto/co.edu.unimagdalena.projecto.informacion2} solved ActivityNotFoundException: Unable to find explicit activity class {co.edu.unimagdalena.projecto/co.edu.unimagdalena.projecto.informacion2}

[Solved] Extra from Activity B to Activity A

Write Activity A like this public class MainActivity extends Activity { TextView textView1; Button button1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView1=(TextView)findViewById(R.id.textView1); button1=(Button)findViewById(R.id.button1); button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent intent=new Intent(MainActivity.this,SecondActivity.class); startActivityForResult(intent, 2);// Activity is started with requestCode 2 } }); } // Call Back method to get the … Read more

[Solved] How to call this function from other activities?

Create Kotlin file, e.g. named Utils; Move function to that file, and add Context parameter: fun checkConnectivity(ctx: Context): Boolean { val cm = ctx.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val activeNetwork =cm.activeNetworkInfo return activeNetwork != null && activeNetwork.isConnectedOrConnecting } If you intend to use it only in Activity you can create extension function without Context parameter: fun Activity.checkConnectivity(): … Read more

[Solved] How to send data to new Android activity

RadioGroup radioGroup = (RadioGroup) this .findViewById(R.id.radio_group); radioGroup .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup radioGroup, int id) { final RadioButton radioButton = (RadioButton) radioGroup .findViewById(id); String selectedText = radioButton.getText().toString(); Intent i = new Intent(this, PersonData.class); i.putExtra(“cakedata”, selectedText); startActivity(i); } }); solved How to send data to new Android activity