Skip to content
Advertisement

How to launch Telegram app from my own android application?

I have an android app that should be able to open a chat in the telegram app by pressing a button.
I want to open an existing robot chat page DIRECTLY from my app. I have a valid token for my robot. How can this be achieved?

Thanks in advance.

robot name : @InfotechAvl_bot

robot token: 179284***********

   //-------------
    case ContentFragment.lMenuTelegram:
     Intent LaunchIntent=getPackageManager().getLaunchIntentForPackage("org.telegram.messenger");
     startActivity(LaunchIntent);
            break;

Advertisement

Answer

To solve this problem you have to open robot id with this :

Intent telegram = new Intent(Intent.ACTION_VIEW , Uri.parse("https://telegram.me/InfotechAvl_bot"));
startActivity(telegram);
Advertisement