user2828933
user2828933

Reputation: 43

Class as a Popup for Android App

I have:

MainActivity.java,
Food.java (with layout food.xml),
food.xml (in GridView)

In my MainActivity class, I have a button where I want a popup to show up after clicking it. I am able to show a xml file as a popup, or move screens to another class, but is there a way to show the Food.java class as the content of the popup?



Also, the Food.java has a GridView with an ImageAdapter

Upvotes: 2

Views: 73

Answers (2)

George Thomas
George Thomas

Reputation: 4586

You can start an activity as a dialog using the following,and you can add custom animations on how to show the activity.

<activity android:theme="@android:style/Theme.Dialog" />

Upvotes: 1

Laxmeena
Laxmeena

Reputation: 790

You can use ViewSwitcher for that. you can create Button in 1st part of ViewSwitcher and rest of the content in the second part and name it food.xml.

For more help see:- http://sampleprogramz.com/android/viewswitcher.php

Upvotes: 0

Related Questions