Android :: Starting An Activity As A Dialog Without Using A Theme Modifier

Sep 23, 2010

I want to start an activity as a dialog, which can be simply done by: <activity android:theme="@android:style/Theme.Dialog">

But I want to do control the dialog, so I've to do it programmatically. Basically I want to modify this property of dialog: mCanceledOnTouchOutside = true

This will make the dialog cancel itself when touched outside of it's bounds. (Basically I want to replicate the popup behavior). The issue is I can't simply create a dialog and set it's layout since I need a call to activity (to initialized datasets)

Android :: Starting an activity as a dialog without using a theme modifier


Android :: Trying To Create Basic AlertDialog Using Activity With Theme Of Theme.Dialog

Sep 10, 2010

I'm trying to create a basic AlertDialog using an activity with a theme of Theme.Dialog.What I want is for there to be a horizontal bar between the title and the message. However, the bar is not being resized correctly. Rather than being the width of the activity, the bar is the width of the message text. This means that if the activity is being expanded by the message, then the bar will fill the whole activity, so it looks correct. However, if the message width is less than the activity width, the bar only displays above the part of the activity with the text. I've tried every single combination of "fill_parent" and "wrap_content" that I can think of, and none of those work.I've also tried using RelativeLayout and placing the bar above the message text, but that also doesn't work. If I use the RelativeLayout approach and set the bar to fill_parent, it causes the activity to expand to fill the whole screen width, which is also undesirable. Ideally, I want the text placed, the activity width computed, and the bar resized to that width (without affecting it). Is there some way to flag a view to fill the parent view but not to affect its size?

View 1 Replies View Related

Android :: Progress Dialog While Starting New Activity

Feb 9, 2010

this button is shown on my start activity. After pressing it a new activity will be launched but this takes some time cause on initialization of that new activity some data is gathered from the Internet. This works half. The progress dialoge is shown but the progress wheel is not spinning.

Can somebody tell me why this happens?
Button b4 = (Button) findViewById(R.id.Button01);
b4.setOnClickListener(new View.OnClickListener() {
public void onClick (View view) {
final ProgressDialog pd = ProgressDialog.show(pak.this,
"", "Working..", true);......................

View 1 Replies View Related

Android :: Sub Activity Doesn't Die - In Theme Dialog

Aug 27, 2009

I have an application with an activity A which creates an activity B (in theme dialog). I push the button in my activity B to finish it, i come back on activity A, it is ok. Then I press the button return on my G1, i go back on my home screen. And now if i do a long press on the home button, and i click on my application, it is the activity B which appears ! I finish my activity B, with this code : setResult(RESULT_OK); finish();

View 4 Replies View Related

Android :: Tunning Up Activity With Dialog Theme

Jun 15, 2010

I need to launch a Dialog from home screen widget, so I created an Activity with android: theme=" @android: style/Theme.Dialog"The problem is, that I would like make it look like standard dialog window ( buttons on the gray background, font and text size, paddings etc),Is there some standard way (theme?) to make it look like standard system dialogs? Or do I have to imitate it in my own layout?

View 1 Replies View Related

Android :: Dialog Theme When Launching From Another Activity

Aug 24, 2009

I am facing a strange problem. I have 2 activities.The Second activity having the theme.Dialog (set in manifest). when I launched the second activity from first activity via startActivityforResult(). The Second activity is not Visible.

View 8 Replies View Related

Android :: Wrap Title Of Activity With Dialog Theme?

Mar 6, 2010

I have an activity with the dialog theme applied to it. I am setting the dialog title, but the string is quite long, and instead of wrapping, it just gets truncated. Is there a way to wrap the title instead?

View 2 Replies View Related

Android :: Theme.Dialog Activity And Context Menu

Jun 22, 2009

i have dialog style activity android:theme="@android:style/Theme.Dialog"The menu appears about 50 px from the bottom of this dialog. So if activity screen is too small - it right in the middle of the screen. Is there any way to anchor menu to the bottom of the screen?

View 5 Replies View Related

Android :: Best Practice For Overriding Both Theme And Theme.Dialog Correctly In An App?

Jul 15, 2009

I use themes in my apps, which generally just extend android:Theme and then set a bunch of styles. I use dialogs made from layouts, but since I set the theme for the application, they have inherited all of the regular styles and no longer carry a border, etc. My question is: How do I say, "I want everything to use this theme which extends Theme, except dialogs, which should use this other theme that extends Theme.Dialog"? It seems like that's how things work by default but when you set the theme to your own, you lose the dialog theme!

View 3 Replies View Related

Android : Extending Theme Dialog - Unable To Theme In Project

Mar 6, 2009

I've extended Theme.Dialog to use a different color as per the sample in the ApiDemos project but for some reason it does not use the theme properly in my project. I created a new project and it works perfectly fine there. The main problem here is that it does not show as floating in my project. Instead, it sets the rest of the screen black except for what would be the dialog window, where it uses the correct colors, etc. Any ideas? I am beating my head against the wall here.

View 2 Replies View Related

General :: Rom Starting With Theme?

Mar 24, 2013

how can I make my Rom, on first boot, start with theme and not original System ?

View 2 Replies View Related

Android :: Starting Second Activity From Main Activity On Button Click

Dec 4, 2009

Need an example of how to create/start a new activity from the main activity. I have a button click event on the main layout. Originally I just used setContentView(R.layout.secondactivity); which brings up the layout but I don't think that is correct since the secondactivity class is not instantiated at this point yet. I have looked for such an example and can not find one.

View 3 Replies View Related

Android :: Theme.Dialog For PreferenceScreen Child Does Not Work

Jan 25, 2009

I have a PreferenceActivity defined in the manifest with android:theme="@android:style/Theme.Dialog. The theme works well with the first settings screen, but not with the child PreferenceScreen elements (if I have several screens in my preferences). The child screens have the default Theme applied in this case.If the theme is changed to Theme.Light or the default, it works well for all the screens(parent and children included)Is there a way to apply the theme to the children, or is this a BUG ?

View 11 Replies View Related

Android :: Starting Map Activity From Normal Activity

Apr 25, 2010

I have a map app which works fine when its stand alone but it causes an unexpected error when I try to add it as part of another app. My current app which extends Activity tries to launch the map activity with the following lines of code Intent m = new Intent(this, HomeSetter.class); startActivity(m); I also have the xml setup correctly <activity android:name=".HomeSetter" android:label="Screen 4"> </activity> <uses-library android:name="com.google.android.maps" /> </application> However when I try to launch it crashes everytime. I've tried searching the net but I've had no joy in finding a solution You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe @googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

View 4 Replies View Related

Android :: Starting Activity Behind Current Activity

Oct 2, 2009

startActivity() displays the new Activity on top of the current one. But how to display it underneath instead? BTW, I'm starting an Activity from another application, if that makes a difference.

View 5 Replies View Related

Android :: How To Show WebView With Theme.Dialog Style In Droid

Aug 29, 2010

I declared a WebView activity in the manifest like this. code...

When I start this activity within my main activity, only the title of the dialog, containing the apps name, is visible but not the WebView. If I add a TextView to the LinearLayout, it is shown as well, but still the WebView is missing.
If I don't apply android:theme="@android:style/Theme.Dialog" in the manifest, the WebView is displayed.

Why is that and how can I show a WebView in a dialog?

View 2 Replies View Related

Android :: Menu On Center Of Screen If Style Inherit From Theme.Dialog

Feb 17, 2009

If my custom Activity style inherite from android: style/Theme.Dialog: <style name="MyTransparent" parent="android:style/Theme.Dialog"> </style>

The menu associated with my activity pop up on the center of the screen.

Is this the expected behaviour? Is there any workaround?

View 2 Replies View Related

Android :: Starting New Activity From Activity

Jun 9, 2010

When I was originally learning about Android a few months ago I swear I read something about a way to immediately launch an activity when starting a task. I am curious about this now because I need to display an intro screen on launch but I don't want the intro screen to be the root activity. Does anyone know if there is something like this and if not what is the best way to handle an intro screen?I tried googling for a few hours to find it but can't for the life of me.

View 1 Replies View Related

General :: Can Android Modifier Key Fallback On Action?

Oct 23, 2012

I'm working on an input device that has a button that I'd like to act both as a home button when pressed by itself, but also work as a modifier for the other buttons on the device. I know you can do this in the kcm file with other buttons, and have something like:

Code:
key ESCAPE {
base: fallback BACK
alt, meta: fallback HOME
ctrl: fallback MENU
}

Is it possible to have something like:

Code:
key CTRL_LEFT {
base: fallback HOME
{SOMETHING HERE}: CTRL_LEFT
}

So that I can press that button with another button and have it not fallback on HOME?

View 1 Replies View Related

Android :: Starting Activity With FLAG ACTIVITY MULTIPLE TASK To See Multiple Instances

Feb 2, 2009

I am trying to launch an activity from another activity .. Within the com.android.SingleLauncher..

I have activity launch code as ..

CODE:...........

I have set the android:multiprocess="true" in the AndroidManifest.xml of TargetSL I don't seem to see the multiple instances of TargetSL, which i am expecting ..

All i see is 2 process, where i was hoping to see an instance of TargetSL, for each launch that was invoked by the singleLauncher!

View 3 Replies View Related

Android :: Starting Activity With Tabs

May 7, 2010

I have four activity in a Tab and after the user clicked on the list I would like to start another one activity, but I can't use startActivity(Intent), because then I lost the TabHost view, and I get an activity witch is reserving the full screen:( So the user won't be able to click on the other tabs. What should I use? BroadCastReciver or What? If anyone have any good idea please help on me.

View 4 Replies View Related

Android :: Starting Activity By Package Name

Mar 25, 2010

I have the code to get the list of packages installed in phone. I have represented the list in the form of Array List, below is the code snippet. But upon clicking in the package name I want to start that application, but how do I get the respective class name and package name to run? Is there any other method which I can try to start an application? arrayList<String> PackageNames = null; List<PackageInfo> lis = pm.getInstalled Packages(GET_MINIMAL); Pkgs = (ListView) findViewById(R.id.package_list); for (Package Info pi : lis)packages.put(pi.packageName, pi); PackageNames = new ArrayList<String> packages.keySet()); Collections.sort(PackageNames); PackageNames.add(0, "All"); pgs.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple _list_ item_1, PackageNames)); Pkgs.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View v, int pos,long rowId) { Intent i = new Intent(); i.setComponent(new ComponentName(class name,packagename)); startActivity(i); I have tried intent to start the activity, but don't know the class name and package name to pass in the ComponentName() to start activity.

View 2 Replies View Related

Android :: Error When Starting Activity

Mar 22, 2010

I'm starting an activity when a button is pressed, and normally (in other apps) haven't had an issue. But when I press the button in this app, I get an "unable to marshal value" error.Exact(ish) error from LogCat:
03-22 02:49:02.883:
WARN/System.err(252):
java.lang.RuntimeException: Parcel:
unable to marshal value
{CLASSNAME}@44dcf1b8
I feel that this might be related to the extra that I'm passing to the intent. I'm passing an ArrayList as a serializable to this new intent. My concern is that the data structure that the ArrayList contains isn't being serialized (as it's a personal data structure).Is the array list content data structure causing this? Something else that I'm missing?

View 1 Replies View Related

Android :: Starting An Activity For Different Third Party App

Aug 19, 2010

I'm working on an app and I want to integrate the Last.fm app into it. Basically, when someone is looking at an artist in my app, I would like to have a button that they can tap to open up Last.fm application with the artist's information.

This intent works, but it loads a menu asking which app I would like to use (Browser or Last.fm):

CODE:..........

However, I just want to start the Last.fm app and skip the dialog asking which app to use, I thought maybe using the setPackage() method would work like this: i.setPackage("fm.last.android");


But it causes the app to crash:

CODE:............

Is it possible to just start the Last.fm app?

Here's a copy of Last.fm's AndroidManifest.xml for reference.

View 1 Replies View Related

Android :: Error When Starting A Tab Activity?

May 16, 2010

I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

However, when I try to run in the Android emulator, I get the error: "The application Hello Tab Widget has stopped unexpectedly. Please try again."

I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.

View 2 Replies View Related

Android :: Tabs - Starting A New Activity

Dec 31, 2009

I have 4 Tabs in a TabHost...let them be A,B,C,D.... now each one is just an index page and clicking on any of them shows a different activity...

The problem is that i need to start another activity wen user selects something from the content displayed in the tab... The other activity should also be displayed in the parent tab itself... is it by any chance possible or i'll have to try some other way around?

View 2 Replies View Related

Android :: Starting An Activity In OnStart

Apr 14, 2010

I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins.

I have the following:

CODE:............

And callProfileDialog() is just:

CODE:..........

ProfileDialog.class returns a String from an input box. If the result returned is RESULT_CANCELED then I restart the activity.

The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a RESULT_CANCELED is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a RESULT_CANCELED). Why can't I get the activities show by calling ProfileDialog.class from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart().

I have also tried the following:

CODE:.........

But this doesn't work either. It all works fine once I hit the back button but without doing that, it's all black.

View 3 Replies View Related

Android :: OnRecieve Starting Activity?

Jun 23, 2009

I would like to know the reason behind this behaviour.I have a broadcast reciever and in onrecieve i am trying to start an activity,however if i am not giving the flags it is giving an exception .On declaring the flags it is working perfectly fine,why?

I was under the impression that onRecieve runs in the main UI thread and we can launch an activity in onRecieve.Error given by the emulator is self explanatory but still why do i need to create an activity in a new task(only in onRecieve)?

CODE:....................

View 4 Replies View Related

Android :: Name Of Droid App Taken As Of Starting Activity / Why Is This?

Oct 18, 2010

In my manifest file, I have given the application name as MyApp and the name of the starting activity as Main Menu.code...

When I see the app icon in the default menu screen of android, the name shown is Main Menu. Why is MyApp not the name shown for the app?

View 2 Replies View Related

Android :: Previous App Launches Not Starting Activity

Jun 2, 2010

I need a way to detect if this is the first time the user is ever opening the application, if so, start an activity. Then all previous application launches wouldn't start that activity. I've read in a few places about using preferences to accomplish this. Anyone got any ideas?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved