开发者

How can I show an intent in a new Dialog? [duplicate]

This ques开发者_开发百科tion already has answers here: Closed 11 years ago.

Possible Duplicate:

Android Activity as a dialog

I have a little problem with an intent that call an Activity that show a chart. I want to show the activity in a new Dialog, how can I make it?

this is the code that call the Activity:

    Intent intent = ChartFactory.getBarChartIntent(
            chartproject.this, buildBarDataset(titles, values),
            renderer, Type.STACKED);    
    chartproject.this.startActivity(intent);


You only need to make change in AndroidManifest.xml as shown below,

<activity android:name=".className"
              android:label="Choose Category..."
              android:windowSoftInputMode="stateAlwaysVisible|adjustPan"  
                android:theme="@android:style/Theme.Dialog">   </activity>

where,

className: main class name of activity that you want to show in dialog.

that's it. you will have your activity as dialog.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜