Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Android launch Twitter intent (launching a user's feed)

$
0
0

Hi,

I try to open twitter users feed. Width

var myAccounts = require('org.bcbhh').getAccounts();
var twitter = null;
for (var i = 0; i < myAccounts.length; i++) {
    if (myAccounts[i].accountType == 'Twitter')
        twitter = myAccounts[i].name;
}
I can detect if twitter account is available and the name of account. Now I can open an intent – this is native solution:
Intent intent = null;
try {
    this.getPackageManager().getPackageInfo("com.twitter.android", 0);
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?user_id=USERID"));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/"));
}
this.startActivity(intent);
How can I achieve this in Titanium?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>