Android :: How To Determine View Size Right After Activity Has Been Started?
Feb 19, 2010
I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight? Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)
View 1 Replies
Aug 20, 2010
I want to be able to tell if a view is visible in my listview, which is populated by a custom CursorAdapter. How can I do this?
View 1 Replies
View Related
Nov 2, 2010
I have a TabActivity, and each Tab corresponds to its own Activity. In one of them, in the onCreate method, I use startActivityForResult to show a dialog (specifically, Bump's BumpAPI activity).
code:...............
The problem is that when the screen orientation changes, it tries to create the tab's activity again which makes another BumpAPI dialog, resulting in multiple stacked on top of each other. Do I have a hook into the started activity to cancel the previous one when the orientation changes?
A workaround seems to be to add a button that when clicked, starts the second activity, but that adds an unnecessary step.
Also, I can't fix the screen orientation for the entire tabActivity because some of them require typing and users may want to use their physical keyboards.
View 1 Replies
View Related
May 1, 2010
I have following problem with my application: From my main activity ("activity 1"), there is a menu from which user can launch an action. This action will result in an Intent being received by a BroadcastReceiver, defined in my application. Finally, this BroadcastReceiver will start an activity ("activity 2") to deal with this intent.
The problem is that I have a "quit application" entry in my menu, and I can only finish() currently active activity. ie I am not able to finish "activity 1" from the menu of "activity 2". And I can't use startActivityForResult() as "activity 2" can't be started from "activity 1". Any suggestion would be much appreciated Thank you very much guys, regards.
View 4 Replies
View Related
Mar 9, 2010
How can I determine/calculate the byte size of a bitmap (after decoding with BitmapFactory)? I need to know how much memory space it occupies, because I'm doing memory caching/management in my app. (file size is not enough, since these are jpg/png files).
View 1 Replies
View Related
Apr 26, 2010
Yesterday morning i removed some apps from my rooted 2.1. Nothing exotic, i'm not at that level of exploration, just the common ones recommended like the stock widget & apps (all 3 instances & their .odex) and the visual voice mail. later in the evening i felt the phone wasn't performing as it should. Taking an xxl image with my fav photo app vignette cause the phone to freeze & i had to remove the battery, the same happened with meebo. how can i see an apps size from the command prompt?
View 2 Replies
View Related
Sep 7, 2010
I have few queries on Android SQLiteDatabase
1.) As normally the database stored in internal memory, can we specify the path of external storage and use it in similar way ?
2.) How to determine the size of available space of database ? I used getMaximumSize() from SQLIteDatabase class but that gives me 1099511626752
Is this in bytes ? If assumed then this seems to be too large and not practical. I am using HTC G1 to test this.
3.) How can I determine the size of an entry in table ? Or do I have to pull the whole table and manually see its size. Is it same that would be in phone storage ?
4.) Can I check if any free space available before making entry in database ? I want to prevent SQLiteFullException.
View 1 Replies
View Related
Sep 23, 2010
So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file
View 1 Replies
View Related
Mar 4, 2010
I am planning to have a Service send a broadcast which a BroadcastReceiver will act on and I would like it to create a Notification if an application is not currently on screen, but if the application is on screen (ie. showing to the user) then I would like to offer a Dialog and not create the Notification.Is it possible to determine if an Activity or application is currently on screen?
View 5 Replies
View Related
Mar 31, 2010
I just want to get numbers of times to be used for each Activity.
So the very straightforward method I thought is increasing the count for an Activity when it was started. But how can I get the information?
View 3 Replies
View Related
Jun 18, 2009
Is there a way to do this?
Can you access the activity stack in a way to grab what activity came before the one now in view?
I have a situation where an activity needs to know where it was started from, so it knows what data to display in that current activity.
View 7 Replies
View Related
Oct 19, 2010
How can I know what Activity has started the current Activity? Is there any specific method like, i.e. getIntent().getCallerActivity() or the only way is saving some information within the Intent using putExtra()?
View 1 Replies
View Related
Apr 9, 2009
I have a TextView inside a ScrollView and I have loaded it with a bunch of text. When the ScrollView gets to the bottom/top I would like to load the TextView with new data BUT there doesn't appear to be any way to find out when you have reached either location. Could some one help me out with this? How can this be done?
View 5 Replies
View Related
Jul 19, 2009
I have an application that is loading the street view application at a given latitude and longitude. I was wondering if anyone knows a way of determining if a streetview is available at a specific location, so that instead of loading the streetview and trying to download a view somewhere where it is unavailable, ultimately throwing an error, I can display a message instead. The maps application can do it but I can't seem to find a way using the android api, maps api or any of the intent uri's.
View 5 Replies
View Related
Aug 25, 2010
I have a central activity that can be launched from two separate classes. I was hoping that in this central activity I could have an IF statement like
if(this.getIntent() == MainMenu.class)
{
// Do something here
}
But obviously that isn't legal so how could I structure an expression to check from what class an intent was started.
View 2 Replies
View Related
Jun 25, 2010
I have small simple Service and big MainActivity with UI. Service is called periodically from AlarmManager. My Service need to know if MainActivity is on the screen and inform MainActivity about state changing.
View 3 Replies
View Related
Jul 21, 2010
Suppose my application P started Activity A, and A started Activity B, then the activity stack contained A and B, with B at the top.
After that, I opened other apps by pressing Home button. Suppose after a while, the process of application P is killed by the OS. Then, I press Home button to select application P. At this time, which activity will be brought to the front, Activity A or Activity B?
View 1 Replies
View Related
Jun 17, 2010
I've a service which listens to user request for ending one activity and starting another activity. For Ex: Say there are activities1,2 ,& 3. Now if there is already activity1 started by someother activity then based on the user request i need to stop activity1 and start activity2 or activity3. If the acitivity1 is started by my service then i can do finishactivity(requestcode) and shall receive a call to onActivityResult() then i can start next activity 2 or 3. But can i stop the activity1 which is started by some other activity from a service?
View 2 Replies
View Related
Mar 19, 2010
I've successfully implemented a BootReceiver, AlarmManager, and Service per the code here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices...
Inside the doWakefulWork method of the Service I am instantiating a few classes, but some of them require my Activity to be running. How do I actually start the Activity? The code above only starts the AlarmManager and Service.
There are also times where the Activity *is* already started, like if the user manually opened it. So I also need to start the Activity "only if it's not already running". Hows that work?
And what about the situation where the user first installs your application and may not even reboot their phone for a week. In that case, do you have to start the Service from the Activity? But then the Service will die with the Activity.
View 7 Replies
View Related
Jun 30, 2010
At the beginning Activity is launched by an Intent and something is done with this Intent. When I change orientation of my Activity, it's reloaded again and Intent is passed to the Activity. How can I clear that Intent to prevent Activity from using it again?
View 1 Replies
View Related
Jun 9, 2010
Applications can have any number of launchable activities. I know how to get the list of these activities via PackageManager.
Is there a way to determine which activities can be launched via startActivity?
For example, the Documents To Go app has different activities that will start Word, Excel, Powerpoint, PDF, etc... I am able to launch all o these just fine.
However, it also contains some activities that I am not able to launch with startActivity... If I attempt to do this I get a SecurityException.
I want to be able to determine which activities I can safely launch and which I cannot so I only present the user with a list of activities that I can safely launch from within my application...
View 1 Replies
View Related
Aug 16, 2009
I want my background service to determine the active package or activity running.Is this possible?
View 4 Replies
View Related
Oct 1, 2010
but no use even if try increasing the minheight....
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Here you put the rest of your current view-->
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"........................
View 6 Replies
View Related
Apr 11, 2010
I've got an Android application which needs to be woken up sporadically throughout the day.To do this, I'm using the AlarmManager to set up a PendingIntent and have this trigger a BroadcastReceiver. This BroadcastReceiver then starts an Activity to bring the UI to the foreground.All of the above seems to work, in that the Activity launches itself correctly; but I'd like the BroadcastReceiver to notify the Activity that it was started by the alarm (as opposed to being started by the user). To do this I'm trying, from the onReceive() method of the BroadcastReceiver to set a variable in the extras bundle of the intent,Can anyone tell me what's different about passing a bundle from a BroadcastReceiver to an Activity, as opposed to passing the bundle from an Activity to a BroadcastReceiver?
View 2 Replies
View Related
Aug 20, 2010
In my app I want to obtain a gps lock and record the coords. But I do not want to lock the device into looking for the gps. The user is to be free to traverse through the app and the different activities within.
So If I call a locationListener in activity A, can I reference it in activities B C and D?
if is was still in activity A I could say something like
A.this.mlocListener.removeMyUpdates();
When I am in activity B how can I reference the LocationListener I set up in Activity A
View 1 Replies
View Related
Apr 6, 2010
i've developed an android app that's fetches an xml file and displays this data via several markers on the map. This works fine so far. The problem right now is that when i switch the orientation of the phone (portrait->landscape or vice versa) the markers disappear for a small moment, the xml processing is started again and then they reappear. Is there a way to prevent this re-loading of the file? It only takes about 2-3 seconds.
View 2 Replies
View Related
Jul 22, 2009
I have one Activity, that starts one Service and my service will lunch one Activity, i wanna to stop the Activity which one started my my Service after few seconds. Is there any way to achieve. Has anyone experienced this type of scenario.
View 2 Replies
View Related
Aug 13, 2010
In my game when the user completes a stage, I want the main game thread to pause/sleep/wait and a new activity to be launched called StageClear that displays information about points scored etc. After this has been displayed and the user has pressed continue I want the original game thread to resume where it left off. I have tried to implement this but have so far been unsuccessful, probably because I'm new to dealing with multiple threads and also the idea of synchronizing them. I most recently tried to implement a shared package-visible object that could notify after wait was called on itself, but I am getting errors in eclipse so it won't even compile, I think because though the object is declared public in an inner class, it cannot be seen or recognised by my activity elsewhere in a file in the package. I have already built both activities but my issue is getting the main game one to launch the other, and pause whilst it waits for this activity to finish, before the main game thread continues execution.
View 1 Replies
View Related
Sep 23, 2010
I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online.
CODE:..................
View 3 Replies
View Related
Aug 25, 2010
CODE:..........
Here is the code where the problem lies....
It doesn't give me an error it says exactly this when I run the android emulator
"[2010-08-25 09:12:42 - doppler_test] ActivityManager: Warning: Activity not started, its current task has been brought to the front"
What I think this means is that the intent of the bluetooth function and the button intent is only operation on a hierarchy system. What I mean by this is that if I were to move the button opperator above the Bluetooth stuff the button will work, but currently when the app is run Bluetooth works but when I press the search button nothing happens.
What else may be helpful is my XML code for the button so here it is......
CODE:..........................
View 1 Replies
View Related