Skip to content

Instantly share code, notes, and snippets.

@ytRino
Created September 28, 2012 09:08
Show Gist options
  • Save ytRino/3798789 to your computer and use it in GitHub Desktop.
Save ytRino/3798789 to your computer and use it in GitHub Desktop.
assetsが許されるのは、sy(
public static Twitter getTwitter(Context ctx) {
InputStream is = null;
TwitterFactory tf;
try {
is = ctx.getResources().getAssets().open("twitter4j.properties");
PropertyConfiguration conf = new PropertyConfiguration(is);
tf = new TwitterFactory(conf);
} catch (IOException e) {
tf = new TwitterFactory();
} finally {
try {
if (is != null) is.close();
} catch (IOException e) {}
}
return tf.getInstance();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment