开发者

Android: Define animation in XML file

开发者 https://www.devze.com 2023-03-11 22:13 出处:网络
I created a class extending AsyncTask, see code below. public class myTask extends AsyncTask<Object, Integer, Object>

I created a class extending AsyncTask, see code below.

public class myTask extends AsyncTask<Object, Integer, Object>
{
    protected Context objContext;
    public final Dialog dialog;

    public myTask (Context context)
    {
     objContext = context;
     dialog = new Dialog(objContext);
     **dialog.setContentView(R.layout.loading);**
     dialog.setTitle("Random Message goes here....");
     dialog.setCancelable(false);
    }

    @Override
    protected void onPreExecute()
    {
     // TODO Auto-generated method stub
     super.onPreExecute();
     dialog.show();
    }
    .
    .
    .
    .
开发者_StackOverflow    .
    .
}//End of the class

How can I define the whole animation in the loading.xml file so no need to update dialog UI from any other function.


I am not sure it could work, but definie an animation as usual and call startAnimation on the view as the dialog shows.

Regards, Stéphane

0

精彩评论

暂无评论...
验证码 换一张
取 消