Home > Software engineering >  how to open user by phone number in imo messenger?
how to open user by phone number in imo messenger?

Time:07-08

I want to open a user by phone number in the imo app, but I don't know how to do it.

At the moment i can only open the app:

val intent: Intent? = context.packageManager
       .getLaunchIntentForPackage(imoPackageName)
context.startActivity(intent)

CodePudding user response:

Сhecking this code

context.startActivity(
         Intent(Intent.ACTION_VIEW)
              .setData(uri)
              .setClassName(
                    $imoPackageName, 
                    "$imoPackageName.WelcomeActivity")
                )

CodePudding user response:

Try this:

val uri = Uri.parse("tel:"   Uri.encode(phone))
                            val intent = Intent("android.intent.action.VIEW")
                            intent.setClassName(imoPackageName, imoPackageName)
                            intent.data = uri
                            context.startActivity(intent)
  • Related