【问题标题】:how can i launch a app form other on Android我如何在 Android 上从其他应用程序启动应用程序
【发布时间】:2015-08-27 19:30:48
【问题描述】:

如何从另一个 Android 应用程序启动 Twitter 应用程序?例如,在我的应用程序中,当我按下 Twitter 的按钮时,我有一些社交按钮现在转到 twitter 页面,但我想启动 twitter 应用程序。我该怎么做?

【问题讨论】:

    标签: android twitter launch


    【解决方案1】:

    您需要使用意图,请查看此处:http://developer.android.com/reference/android/content/Intent.html

    【讨论】:

      【解决方案2】:

      你可以试试这个:

      try {
         startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=" + twitter_user_name)));
      }catch (Exception e) {
         startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/#!/" + twitter_user_name)));
      }
      

      【讨论】:

        【解决方案3】:

        您应该使用隐含意图。you can read about it in general here, 还有更具体的解决方案给你here

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-11-06
          • 1970-01-01
          • 2012-04-26
          • 1970-01-01
          相关资源
          最近更新 更多