This is sample project using Twitter4J Authentication/Authorization on Android.
Networking operation on Main thread(e.g. onCreate
), Android throws "android.os.NetworkOnMainThreadException."
Writing code below to ignoring Exception, but should limit it to be used on a test.
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
This sample is using Loader
and LoaderManager.LoaderCallbacks
in the Android Support Library.