How one can Open/Begin one other App reminiscent of gmail, whatsapp, SMS, Fb out of your {custom} Android App?
This video reveals the steps to start out every other App out of your Android App utilizing the intent mechanism. To develop this characteristic, it is very important know the precise bundle title of the App being opened.
The supply code of this App will be discovered at:
https://programmerworld.co/android/how-to-open-start-another-app-such-as-gmail-whatsapp-sms-facebook-from-your-custom-android-app/
We hope you want this video. For any question, strategies or appreciations we can be glad to listen to from you at: [email protected] or go to us at: https://programmerworld.co
bundle com.instance.myopenfunctionapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content material.Intent;
import android.os.Bundle;
import android.supplier.Telephony;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
setContentView(R.structure.activity_main);
}
public void gmailButton(View view){
Intent intent = getPackageManager().getLaunchIntentForPackage(“com.google.android.gm”);
if(intent != null){
startActivity(intent);
}
}
public void whatsappbutton(View view){
Intent intent = getPackageManager().getLaunchIntentForPackage(“com.whatsapp”);
if(intent != null){
startActivity(intent);
}
}
public void FacebookButton(View view){
Intent intent = getPackageManager().getLaunchIntentForPackage(“com.fb.katana”);
if(intent != null){
startActivity(intent);
}
}
public void smsButton(View view){
Intent intent = getPackageManager().getLaunchIntentForPackage(Telephony.Sms.getDefaultSmsPackage(this));
if(intent != null){
startActivity(intent);
}
}
}
source