[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] Using Intent while saving data of previous Activity

You can use onSaveInstanceState void onSaveInstanceState(Bundle out) { String val = … out.putString(“MYVALUE”, val); super.onSaveInstanceState(val); } Then void onCreate(Bundle savedState) { if(savedState != null) { String val = savedState.getString(“MYVALUE”); } } Or do you mean how to put data for another activity? Then you can do Intent i = new Intnet(this, OtherActivity.class); String val = … Read more

[Solved] Add items to listview from other activity

new View.OnClickListener() { public void onClick(View arg0) { EditText edit = (EditText) findViewById(R.id.tskname); Intent i = new Intent(AddTask.this, MainActivity.class); //Bundle bundle = new Bundle(); String TaskName = edit.getText().toString(); //bundle.putString(“NewTask”, TaskName); i.putExtra(“NewTask”, TaskName); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); //i.putExtras(bundle); startActivity(i); } }); You are starting a new Activity each time you want to add an item. Consider using startActivityForResult() Link … Read more

[Solved] how to call another activity from an image button [closed]

First, declare your videoButton variable private Button videoButton; Then, in your MainActivity, instantiate your button variable and set up your onclick listener public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); videoButton = (Button) findViewById(R.id.single_ticket_add); videoButton.setOnClickListener(videoButtonOnClickListener); … Then have your goToVideoOnClickListener start an intent to open your VideoActivity private OnClickListener goToVideoOnClickListener = new OnClickListener() { @Override public … Read more

[Solved] Android: Why can’t I move to another Acivity by using “Intent”?

When you call the method “createNewUser()”, you are inside of an onClickListener. When you pass in ‘this’ as your context, you are passing in the context of your listener. Instead, when calling createNewUser, use ‘MainActivity.this’ as your Context, so then your app knows that the context is the whole activity and not just the listener. … Read more

[Solved] Start and Close single Activity from BroadcastReceiver

You could try to directly kill an activity by calling a static method in that activity: Activity A should have a variable static ActivityA activityA; In onCreate state: activityA = this; and add this method: public static ActivityA getInstance(){ return activityA; } In activity B, call the fuction getInstance() ActivityA.getInstance().finish(); solved Start and Close single … Read more

[Solved] What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

Move <receiver android:name=”.receiver.DialReceiver” android:exported=”true” android:process=”:background” > <intent-filter> <action android:name=”android.intent.action.NEW_OUTGOING_CALL” /> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> </receiver> Outside <activity> tag 2 solved What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

[Solved] How to convert textview as link in android?

You have to setOnTouchListener to the TextView. Here I give you an example: public class MainActivity extends Activity implements View.OnTouchListener { private TextView tv1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv1 = (TextView) findViewById(R.id.tv1); tv1.setOnTouchListener(this); } @Override public boolean onTouch(View v, MotionEvent event) { // HERE YOU HAVE TO CHECK WHICH ID IS … Read more

[Solved] When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class);

When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class); solved When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class);

[Solved] Android – Menu Item Crashing on Click (Camera Intent)

Your error log shows you have SecurityException: Permission Denial…with revoked permission android.permission.CAMERA. This means you are targetting API level 23 and the user has revoked the CAMERA permission. You should add code to check and request permission and handle permission acceptance/denial. Read more about it here. 3 solved Android – Menu Item Crashing on Click … Read more

[Solved] Unable to scrape data from Internet using Android intents

Have you considered using an http framework for Android instead? It’s a lot less code and also runs the requests in the background. This example uses the loopj async client build.gradle: compile ‘com.loopj.android:android-async-http:1.4.9’ compile ‘cz.msebera.android:httpclient:4.4.1.2’ Test code: @Test public void parseHttp() throws Exception { AsyncHttpClient client = new AsyncHttpClient(); final CountDownLatch latch = new CountDownLatch(1); … Read more