Android automatic action run

KuvaajaKuvaaja USMember


I'm asked that same question before but I want to ask that again.

@Kuvaaja said:
How can I run Android action automatically without button click (in app) when app is launched?

If possible, please write code with Java, classes and @Overrides. Because I'm beginner.


I mean how to launch my public void called redirecti automatically when my app is launched?
public class MainActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {

public void redirecti(View view) {
    Intent launchIntent = getPackageManager().getLaunchIntentForPackage("");
    if (launchIntent != null) {


I don't mean any user with @Override or @Overrides.
I am using Android Studio.
I know to how to start that with button click but no without button click.
Please help me.

Best regards
Kuvaaja or Teemu


  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    You can ask, but I don't think you'll get much help here. You are using Android Studio to write Java apps, this is a forum for Xamarin apps built using C# or F# in Visual Studio or Xamarin Studio. So this is not the place to ask.

    Maybe try on Stack Overflow?

  • KuvaajaKuvaaja USMember

    Thanks about the answer.
    Maybe I try on Stack Overflow.
    I'm new in Xamarin.
    Sorry about that question. :(

Sign In or Register to comment.