开发者

replace view in activitygroup with slide in animation in android

I am having following code :

public void onClick(View v) {
    // TODO Auto-generated method stub
    if(v.getId()==R.id.btnSrch){
        Intent i = new Intent(this, SearchByCode.class);
        View view = SearchGroup.group.getLocalActivityManager()
            .startActivity("SearchByCode",i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
            .getDecorView();

             SearchGroup.group.replaceView(view);

    }
}

But when I am clicking the bu开发者_JAVA技巧tton it shows the next screen abruptly. I want to show the slide-in animation here.


I can't quite tell but I think you want to know how to launch another activity called SearchByCode from your current activity.

To do this you need to create an Intent object, optionally add flags or bundles to the intent, then call startActivity(Intent).

Here is a code sample:

Intent i = new Intent(this, SearchByCode.class)
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(i);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜