开发者

Android: Define animation in XML file

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜