add snackbar in android activity from asynktask - java

From main activity i call this background process. here in this background there is onprexecute method there is an if else condition in else part i need to add a Snackbar
public class background extends AsyncTask<String,Void,String> {
private ProgressDialog dialog;
private ProgressDialog progressDialog;
private ConnectivityManager cm;
private String jsonurl, jsonstring;
public static String listRequest;
private mobile_form mform;
private Context ctx;
ProgressBar progressbar;
background (Context ctx){
this.ctx = ctx;
cm = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
dialog = new ProgressDialog(ctx);
progressbar = new ProgressBar(ctx);
progressbar.getIndeterminateDrawable().setColorFilter(Color.parseColor("#039BE5"), android.graphics.PorterDuff.Mode.SRC_IN);
mform = new mobile_form();
}
#Override
protected void onPreExecute() {
super.onPreExecute();
jsonurl = "https://crackstrickblog.000webhostapp.com/json_get_data.php";
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
if (isConnected) {
dialog.setCancelable(false);
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
dialog.show();
dialog.setContentView(progressbar);
}
else {
// here i need to add snackbar like this
//Snackbar.make(this.findViewById(android.R.id.content), "Message", Snackbar.LENGTH_LONG).show();
}
}
#Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
#Override
protected void onPostExecute(String result) {
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
if (isConnected) {
ctx.startActivity(new Intent(ctx, mobile_form.class));
if (dialog.isShowing())
dialog.dismiss();
}
}
#Override
protected String doInBackground(String... voids) {
return null;
}
}

This Snackbar.make(this.findViewById(android.R.id.content), "Message", Snackbar.LENGTH_LONG).show();
will not work. findViewById is a method of activity class not of AsyncTask.
Use interface as a callback.
interface Callback {
public void showSnackBar();
}
In AsyncTask
private Callback callback;
Then
public background (Context ctx){
callback =(Callback) ctx;
Then in onPreExecute
else {
if(callback!=null)
callback.showSnackbar();
}
In activity class implement the interface and the method
public YourActivity extends AppCompatActivity implements Callback {
Then
#Override
public void showSnackBar()
{
// show snack bar in activity
}
You could also use some event bus mechanism instead of the above.

You are not passing a context use your activity to find view in that context as you are in asynchronous class, you don't have access to your activity view.
Snackbar.make(MainActivity.this.findViewById(android.R.id.content), "Message", Snackbar.LENGTH_LONG).show();

A code snippet to display a basic SnackBar is shown below:
Snackbar snackbar = Snackbar
.make(coordinatorLayout, "www.journaldev.com", Snackbar.LENGTH_LONG);
snackbar.show();
In the above snippet make() method accepts three parameters:
coordinatorLayout : It is the root layout of the activity
www.journaldev.com : This is the message to be appear on snackbar, and we can customise it with our own message
Snackbar.LENGH_LONG : This is last parameter which is the time limit how long snackbar to be displayed
show() method is used to display the SnackBar on the screen.
Does this help you?

Related

Memory leak happening. Unable to detect the leak and clean it

I have the below ConnectivityReceiver class that extends BroadcastReceiver which is used to check the internet connection.
Also there is another activity SplashActivity, which implements this class for checking the internet connection. I am registering the receiver in OnCreate and unregistering it in the OnDestroy method. But still, after going to next activity, LeakCanary shows memory leak in SplashActivity.
I have instantiated LeakCanary and few methods in MyApplication class.
Please find below the screenshot of the leak.
Can someone please help me in detecting the memory leak and solving this issue?
ConnectivityReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class ConnectivityReceiver extends BroadcastReceiver
{
public static ConnectivityReceiverListener connectivityReceiverListener;
public ConnectivityReceiver()
{
super();
}
#Override
public void onReceive(Context context, Intent arg1)
{
if(arg1.getAction() != null && arg1.getAction().equalsIgnoreCase(ConnectivityManager.CONNECTIVITY_ACTION))
{
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if(cm != null)
{
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
if (connectivityReceiverListener != null)
connectivityReceiverListener.onNetworkConnectionChanged(isConnected);
}
}
}
public static boolean isConnected()
{
ConnectivityManager cm = (ConnectivityManager) MyApplication.getInstance().getApplicationContext()
.getSystemService(Context.CONNECTIVITY_SERVICE);
if(cm != null)
{
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
return false;
}
public interface ConnectivityReceiverListener
{
void onNetworkConnectionChanged(boolean isConnected);
}
}
MyApplication.java
import android.app.Application;
import com.squareup.leakcanary.LeakCanary;
public class MyApplication extends Application
{
private static MyApplication mInstance;
#Override
public void onCreate()
{
super.onCreate();
mInstance = this;
if(LeakCanary.isInAnalyzerProcess(this))
return;
LeakCanary.install(this);
}
public static synchronized MyApplication getInstance()
{
return mInstance;
}
public void setConnectivityListener(ConnectivityReceiver.ConnectivityReceiverListener listener)
{
ConnectivityReceiver.connectivityReceiverListener = listener;
}
}
SplashActivity.java
public class SplashActivity extends AppCompatActivity implements ConnectivityReceiver.ConnectivityReceiverListener
{
final int REQUEST_CODE_RECOVER_PLAY_SERVICES = 1001, PERMISSION_READ_STORAGE = 0;
RelativeLayout relativeLayout;
IntentFilter intentFilter;
ConnectivityReceiver connectivityReceiver;
Bitmap thumbnail;
#Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_main);
intentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
connectivityReceiver = new ConnectivityReceiver();
registerReceiver(connectivityReceiver, intentFilter);
if(checkInternet())
{
Intent mainIntent = new Intent(SplashActivity.this, WelcomeActivity.class);
SplashActivity.this.startActivity(mainIntent);
SplashActivity.this.finish();
}
}
boolean checkInternet()
{
boolean isConnected = ConnectivityReceiver.isConnected();
showSnack(isConnected);
return isConnected;
}
private void showSnack(boolean isConnected)
{
Snackbar snackbar = Snackbar.make(relativeLayout, AppConfig.noInternet, Snackbar.LENGTH_INDEFINITE);
if(!isConnected)
{
snackbar.setAction("GO OFFLINE", new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent mainIntent = new Intent(SplashActivity.this, WelcomeActivity.class);
SplashActivity.this.startActivity(mainIntent);
SplashActivity.this.finish();
}
});
View sbView = snackbar.getView();
TextView textView = sbView.findViewById(android.support.design.R.id.snackbar_text);
textView.setTextColor(Color.WHITE);
snackbar.setActionTextColor(getResources().getColor(R.color.colorPrimary));
snackbar.show();
}
else
snackbar.dismiss();
}
#Override
public void onDestroy() {
unregisterReceiver(connectivityReceiver);
connectivityReceiver = null;
super.onDestroy();
}
#Override
public void onPause()
{
super.onPause();
}
#Override
public void onResume()
{
super.onResume();
MyApplication.getInstance().setConnectivityListener(this);
}
#Override
public void onNetworkConnectionChanged(boolean isConnected)
{
showSnack(isConnected);
}
}
you need to unregisterReceiver(connectivityReceiver); receiver in onPause() or onStop();because onDestroy(); will not called until the Activity in stack of Activities. onDestroy(); will called when you will finish the Activity and unregisterReceiver(connectivityReceiver); will be excuted.

How to allow the device rotation while onPostExecute (UI Blocking Task) running

I'm new to android but based on my understanding that onPostExecute has to run on the main UI thread to be able to access Views and so on which blocks the UI until it finishes. But the application looks ugly -as if it's crashing- when I try to rotate the device while onPostExecute is running (I know it should be a light weight task but I keep in mind slow phones so this might actually happen in my HBO)
Now, here's my code and I know I believe I should use interfaces for communication between my Task, Fragment, and Activity but it's just a proof of concept for now.
//MovieTask Class
public class MovieTask extends AsyncTask<Void, Void, String> {
private Activity activity;
public MovieTask(Activity activity) {
onAttach(activity);
}
//should be an interface
public void onAttach(Activity activit) {
this.activity = activit;
}
//should be an interface
public void onDetach() {
this.activity = null;
}
#Override
protected String doInBackground(Void... params) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
Log.e("ASYNC TASK", "DONE");
return "DONE: FROM DO TO POST";
}
#Override
protected void onPostExecute(String s) {
if(this.activity != null)
{
((MainActivity) activity).ShowResult(s);
Log.e("MovieTask", "Result Received");
}else
Log.e("MovieTask", "Activity is null (1)");
}
}
//My Non-UI Fragment to decouple the Task from the Activity
public class NonUIFragment extends Fragment {
private MovieTask myTask;
private Activity activity;
public NonUIFragment() {
// Required empty public constructor
}
public void BeginTask() {
if (activity != null) {
myTask = new MovieTask(activity);
myTask.execute();
}
}
#Override
public void onAttach(Context context) {
super.onAttach(context);
//check that the passed context is an Activity first then,
if (context instanceof Activity) {
this.activity = (Activity) context;
if(myTask != null) {
myTask.onAttach((Activity) context);
}
}
}
#Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setRetainInstance
setRetainInstance(true);
}
#Override
public void onDetach() {
super.onDetach();
if(myTask != null) {
myTask.onDetach();
}
}
//Main Activity (Task Consumer)
public class MainActivity extends AppCompatActivity {
NonUIFragment nonUIFragment;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
nonUIFragment = new NonUIFragment();
getSupportFragmentManager()
.beginTransaction()
.add(nonUIFragment, "nonUIFragment")
.commit();
}
else
{
nonUIFragment = (NonUIFragment) getSupportFragmentManager().findFragmentByTag("nonUIFragment");
}
Button btn = (Button) findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
nonUIFragment.BeginTask();
}
});
}
//should be the consumer interface
public void ShowResult(String result)
{
try {
Thread.sleep(5000);
TextView txtVw = (TextView) findViewById(R.id.txtVw);
txtVw.setText(result);
} catch (InterruptedException e) {
Log.e("MovieTask", "mCallbacks is null (2)");
}
}
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
TextView txtVw = (TextView) findViewById(R.id.txtVw);
String result = txtVw.getText().toString();
outState.putString("result", result);
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
String result = savedInstanceState.getString("result");
TextView txtVw = (TextView) findViewById(R.id.txtVw);
txtVw.setText(result);
}
}
UPDATE 1
In the chat Jigs suggested trying 'runOnUiThread', however onPostExecute already runs on the UI Thread so unfortunately it's kind of irrelevant. I guess what I'm trying to do is not block the UI while the behaviour of onPostExecute is a UI-Blocking in nature which makes it kind of impossible. I'll leave the question around in case anybody has different thoughts!

Splash Screen for Android Webview

I have a WebView app and would like to add a splash screen to show either while loading the page, or for a set amount of time. I have tried some other solutions but could not find one that worked. If necessary to know, my splash image is splash.png, located in the drawable folder.
Here is my MainActivity.java
public class MainActivity extends Activity {
private GoogleApiClient client;
#Override
public void onBackPressed()
{
WebView webView = (WebView) findViewById(R.id.webView);
if(webView.canGoBack()){
webView.goBack();
}
if (doubleBackToExitPressedOnce) {
super.onBackPressed();
return;
}
this.doubleBackToExitPressedOnce = true;
Toast.makeText(this, "Tap Twice To Exit", Toast.LENGTH_SHORT).show();
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
doubleBackToExitPressedOnce=false;
}
}, 2000);
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setJavaScriptEnabled(true);
view.setWebViewClient(new MyBrowser());
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
if(isNetworkStatusAvialable (getApplicationContext())) {
view.loadUrl("file:///android_asset/index.html");
} else {
view.loadUrl("file:///android_asset/error.html");
}
}
public static boolean isNetworkStatusAvialable (Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null)
{
NetworkInfo netInfos = connectivityManager.getActiveNetworkInfo();
if(netInfos != null)
if(netInfos.isConnected())
return true;
}
return false;
}
#Override
public void onStart() {
super.onStart();
client.connect();
Action viewAction = Action.newAction(
Action.TYPE_VIEW,
"MLINKS",
Uri.parse("http://host/path"),
Uri.parse("android-app://PACKAGE-NAME/http/host/path")
);
AppIndex.AppIndexApi.start(client, viewAction);
}
#Override
public void onStop() {
super.onStop();
Action viewAction = Action.newAction(
Action.TYPE_VIEW,
"MLINKS",
Uri.parse("http://host/path"),
Uri.parse("android-app://PACKAGE-NAME/http/host/path")
);
AppIndex.AppIndexApi.end(client, viewAction);
client.disconnect();
}
private class MyBrowser extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
boolean doubleBackToExitPressedOnce = false;
}
Thank you for any help!
EDIT:
Define a Progress Dialog:
private ProgressDialog pd;
Then inside your:
view.setWebViewClient(new MyBrowser() {
Insert this:
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
pd.show();
}
#Override
public void onPageFinished(WebView view, String url) {
pd.dismiss();
}
I did something like this at one time. IIRC, it went like this:
First, I created a special ImageView subclass that overrode onTouchEvent() and threw away all the events.
Then for my layout, I had my ImageView subclass overlay the WebView then made it hidden, like this (for example):
<FrameLayout
...
>
<WebView
...
/>
<com.example.TouchHandlerImageView
....
android:src="R.drawable.splash"
android:visibility="gone"
/>
....
</FrameLayout>
Then my code went like this:
Show the splash imageview. (The onTouchEvent() would keep touch events from going through to the WebView underneath)
Start the page loading (In my case, I also had to run some javascript to set up the page)
In WebViewClient onPageFinshed(), hide the splash imageview, displaying the WebView with page fully loaded.
at first thing make a background and show it im main screen till the data is being ready.
use AsyncTask Class because it has 3 methods which them
1- onPreExecute() //don't do anything here
2- doInBackgroundProcess()// fetch your data here
3- onPostExecute()//get back the original background

Combine Activity with Fragment

Learning what I can from the internet and youtube, I'm sure I am not handling this in the appropriate way. I have an existing app which includes a slide out navigation drawer using fragments. I am now trying to get an activity to run within that fragment without any luck. It works when ran on it's own, but after trying to combine the two, I am not able to get "draftactivity" to run properly. The fragment operates as it should.
public class tapsfragment extends Fragment {
public static tapsfragment newInstance() {
tapsfragment fragment = new tapsfragment();
return fragment;
}
public tapsfragment(){}
#Override
public void onAttach(Activity activity) {
super.onAttach(activity);
((MainActivity) activity).onSectionAttached(2);
}
public class DraftActivity extends Activity {
TextView draftfeed;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.draft_activity);
draftfeed = (TextView) findViewById(R.id.draftfeed);
new PostAsync().execute();
}
class PostAsync extends AsyncTask<Void, Void, Void> {
ProgressDialog pd;
XMLHelper helper;
#Override
protected void onPreExecute() {
pd = ProgressDialog.show(DraftActivity.this, "Taps", "Loading posts for ******.com ...", true, false);
}
#Override
protected Void doInBackground(Void... arg0) {
helper = new XMLHelper();
helper.get();
return null;
}
#Override
protected void onPostExecute(Void result) {
StringBuilder builder = new StringBuilder();
for (ItemValue post : helper.posts) {
builder.append("\nPost: " + post.getTitle());
builder.append("\n");
}
draftfeed.setText(builder.toString());
pd.dismiss();
}
}
Activity can't run in a fragment, it's the other way around.

How to use a ProgressDialog properly with an AsyncTask without causing window leaks?

I have an AsyncTask which shows a ProgressDialog. The AsyncTask is started when the activity is started:
public class MyActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_layout);
new MyTask().execute();
}
// ... other code
private class MyTask extends AsyncTask<Void, Void, Void>{
private ProgressDialog dialog = new ProgressDialog(MyActivity.this);
#Override
protected void onPreExecute() {
dialog.show();
}
#Override
protected Void doInBackground(Void... voids) {
// get data from a server
return null;
}
#Override
protected void onPostExecute(Void aVoid) {
// call to a method in MyActivity which updates the UI.
if (dialog.isShowing()) {
dialog.dismiss();
}
}
}
}
This code works perfectly, untill I rotate my screen. Which makes sense, because the context that was used to create the dialog doesn't exist anymore (because the activity is re-created when rotating), and a window leak is caused.
The only solution I could think of isn't a really nice one: create a static instance of the task and dialog, and simply dismiss the dialog when the activity is destroyed, and recreate the dialog in the oncreate method if the task is still running.
So how would I solve something like this without losing functionality (so the dialog must always be shown when the task is running, and rotating the device should be allowed)?
As Raghunandan suggested in his comment, I looked into Fragments and solved my problem.
I created a Fragment which starts my AsyncTask, as explained in the blogpost that Raghunandan provided.
And to make sure that my Dialog didn't get leaked, I created a DialogFragment, as described here (Basic Dialog).
Here's my working code:
My Activity:
public class MyActivity extends Activity implements MyTaskFragment.TaskCallbacks {
private MyTaskFragment task;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_layout);
FragmentManager fm = getFragmentManager();
task = (MyTaskFragment) fm.findFragmentByTag("myTask");
if (task == null) {
task = new MyTaskFragment();
fm.beginTransaction().add(task, "myTask").commit();
}
}
#Override
public void onPreExecute() {
FragmentTransaction ft = getFragmentManager().beginTransaction();
Fragment prev = getFragmentManager().findFragmentByTag("myDialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
StringProgressDialogFragment dialog = StringProgressDialogFragment.newInstance("My message");
dialog.show(ft, "myDialog");
}
#Override
public void onPostExecute() {
StringProgressDialogFragment dialog = (StringProgressDialogFragment) getFragmentManager().findFragmentByTag("myDialog");
if (dialog!=null) {
dialog.dismiss();
}
// update UI
}
// ... other code
}
My Task fragment:
public class MyTaskFragment extends Fragment {
private TaskCallbacks mCallbacks;
private Task mTask;
#Override
public void onAttach(Activity activity) {
super.onAttach(activity);
mCallbacks = (TaskCallbacks) activity;
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Retain this fragment across configuration changes.
setRetainInstance(true);
// Create and execute the background task.
mTask = new Task();
mTask.execute();
}
#Override
public void onDetach() {
super.onDetach();
mCallbacks = null;
}
private class Task extends AsyncTask<Void, Void, Void> {
#Override
protected void onPreExecute() {
mCallbacks.onPreExecute();
}
#Override
protected Void doInBackground(Void... voids) {
// do stuff
return null;
}
#Override
protected void onPostExecute(Void aVoid) {
mCallbacks.onPostExecute();
}
}
public static interface TaskCallbacks {
void onPreExecute();
void onPostExecute();
}
}
My Dialog fragment:
public class StringProgressDialogFragment extends DialogFragment {
private String message;
public static StringProgressDialogFragment newInstance(String message) {
StringProgressDialogFragment dialog = new StringProgressDialogFragment();
Bundle args = new Bundle();
args.putString("message", message);
dialog.setArguments(args);
return dialog;
}
#Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ProgressDialog dialog = new ProgressDialog(getActivity());
message = getArguments().getString("message");
dialog.setMessage(message);
return dialog;
}
}
New Loaders API can help you (available via support package) - man. They will solve problem with rotation, but not a mem. leak. To solve mem. leaks write your own "AsyncTask" (with a "clearContext" routine) and clear it's context in activity's onDestroy (or onPause, depends on your architecture). It may looks like a bicycle, but the task takes max 1 day, and you will have a full control on all the resources you background worker use.
By the way: consider using dialogs through fragments, because it solves dialog kill on screen rotation.
try with sample. it will work. basically just restrict the oncreate call by handling the config change. this solution may help you.
public class MainActivity extends Activity {
LoadProgrssdata task = new LoadProgrssdata();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toast.makeText(this, "oncreate called", Toast.LENGTH_SHORT).show();
task.execute();
}
public class LoadProgrssdata extends AsyncTask<Void, Void, Void> {
ProgressDialog progressDialog;
//declare other objects as per your need
#Override
protected void onPreExecute()
{
progressDialog= ProgressDialog.show(MainActivity.this, "Progress Dialog Title Text","Process Description Text", true);
//do initialization of required objects objects here
};
#Override
protected Void doInBackground(Void... params)
{
//do loading operation here
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
#Override
protected void onPostExecute(Void result)
{
super.onPostExecute(result);
progressDialog.dismiss();
};
}
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Checks the orientation of the screen
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
Log.e("orientation ", "landscape");
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
Log.e("orientation ", "portrait");
}
}
}
and in android manifest file:
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden|screenSize" />
I managed to fix this problem by trying to catch any crash that, may occurs, in doInBackground.

Categories

Resources