Abrir perfil de usuario de aplicaciones de Twitter desde la aplicación de Android
Soy capaz de iniciar la aplicación de Twitter (si existe en el teléfono), pero no puedo encontrar cómo mostrar automáticamente un perfil de usuario específico.
Algo así funciona para Google+:
- Abrir un tweet de Twitter en la aplicación nativa de Twitter en android
- ¿Cómo publicar un tweet utilizando la aplicación oficial de Twitter con la intención y, a continuación, volver a su aplicación?
- Iniciar aplicación twitter
- Cheque Quien estoy siguiendo a través de Twitter4j
- Por qué este error '- La aplicación de sólo lectura no puede POST'
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.google.android.apps.plus", "com.google.android.apps.plus.phone.UrlGatewayActivity"); intent.putExtra("customAppUri", "USER_ID");
Aquí está la forma de Facebook:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/USER_ID")); startActivity(intent);
¿Debería haber el mismo tipo de solución cuando inicie la aplicación de Twitter?
Intent intent = getPackageManager().getLaunchIntentForPackage("com.twitter.android"); intent.putExtra("WHAT_TO_PUT_HERE?", "USER_ID"); startActivity(intent);
- Twitter Cómo obtener el perfil de usuario pic usando el plugin Fabric en android Studio (Fixed)
- Cómo instalar el kit de twitter con el plugin de tejido en el estudio de Android
- Publicar un tweet con la API de Android
- Responder a un tweet mediante intentos, a través de la aplicación nativa de Android
- 403: La solicitud se entiende, mensaje - SSL es necesario código - 92, pero se ha rechazado Twitter Android
- Tejido TwitterKit en Xamarin
- Android Twitter Fabric SDK conflicto con la biblioteca de soporte
- No puede resolver el símbolo 'Twitter' - Twitter Tela
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))); }
Esto está funcionando bien con la nueva aplicación de Twitter. La solución proporcionada por @Baptiste Costa no funcionó para mí.
try { // Check if the Twitter app is installed on the phone. getPackageManager().getPackageInfo("com.twitter.android", 0); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.twitter.android", "com.twitter.android.ProfileActivity"); // Don't forget to put the "L" at the end of the id. intent.putExtra("user_id", 01234567L); startActivity(intent); } catch (NameNotFoundException e) { // If Twitter app is not installed, start browser. startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/AndroTesteur"))); }