Created
September 28, 2012 09:08
-
-
Save ytRino/3798789 to your computer and use it in GitHub Desktop.
assetsが許されるのは、sy(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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