Android :: Detect When Widget Gained / Lost Focus

Aug 13, 2010

What's the best way to detect when a Home Screen Widget has gained or lost focus? An example of losing focus is if the user navigates to another screen or if another screen popped up in front of the Widget.

Android :: Detect when Widget gained / lost focus


Android :: Detect When Another Activity Is Launched Or Loses Focus

Dec 3, 2009

Like the title says, I need to detect when my app loses focus because another app is launched (Phone call comes in, or user hits Home etc.).
Overriding Activity.OnStop does not work because that is called even when switching activities within my app.

View 3 Replies View Related

Android :: How To Keep Focus On A Widget/

Oct 1, 2010

do you know if it is possible to keep focus in a widget even if other widgets that are partially visible or not visible at all changes its height size?I wouldn't like to have my screen jump vertically in front of the user because some other widget updated itself to accommodate more data.

View 2 Replies View Related

Android :: Gallery Widget - Focus And Selection Gone?

Aug 26, 2010

I'm trying to realize how the focus and selection in the Gallery widget is doing their job. I'm facing weird situations when trying to update information (TextViews and Spinner) upon a selected item in the Gallery. The focus and selection is lost. So, using the resource gallery_item_background will end in showing the "unselected" background for the current selected image. I have used the .xml that came with the android sdk, and I can't realize how this is happening. I have set setFocusable(false) and setFocusableInTouchMode(false) to all other Views to try out (and true for the Gallery) without any luck.

I have also add 'in-situ' debug, that is, a menu that updates differents widgets when onItemSelected() is called. So I can see while using the application how the background resource is applied. When set to 'no update' the obvious thing happens. None of the widgets are updated with new values, and the background resource works as expected. When set to 'manual update' (an update in the listener that do: .setText() on the textview) does work depending the current View that is showing the TextViews (I have a ViewFlipper that display 2 differents Layout of the TextViews)...............

View 2 Replies View Related

Android :: Move Homescreen Focus To Specific Widget?

Nov 10, 2009

I'm writing a appwidget and hope to limit a widget can be added only once on homescreen, and for further trying, i hope to show the correct page of homescreen to show the widget, just like native media player widget.

View 2 Replies View Related

Android :: Drawing Focus Highlight In Custom Widget

Jul 6, 2009

I have made a custom widget, very similar to JTable in Swing. It is not editable, and all data is replaced at once, allowing easy checking for the widest item in each column & custom col sizing at replace time. It is a subclass of LinearLayout, filled with re-usable TableRow Objects, sub-classed directly from View.

TableRow is both Clickable, focusable, & focusable In Touch Mode. TableRow overrides onDraw(Canvas), calling super. It draws the first column in Black with Lt gray underneath. If the TableRow isFocused () , then a filled rectangle is drawn, before the rest of the cols (left or right justified based on data type), and borders. Where do I get the color, orange, to draw the filled rectangle indicating focus? android.R.drawable.list_selector_background seems to be a pointer, value 17301602, not an actual color. Placing any real Color in my code draws things fine. Is this 17301602 transparent or something? Am I doing this wrong, or do I just need to know how to fine the orange?

View 2 Replies View Related

Android :: How To Detect If Widget Is On / Off Screen?

Sep 28, 2010

I'm writing a customized view similar to Grid which will be used to hold a large amount of images. I'm using ImageButton to display the images, and I only want to load images onto the buttons once they are on the screen (and just display a static background image when they are not). The reason for it is that I'm fetching images from some back-end service and I only want to fetch them when the buttons are on the screen.To do that, I'd like to know if the widget is on the screen. Is it possible to detect if a widget like button is on/off screen? If not, any suggestions on how to achieve what I'm trying to do?

View 1 Replies View Related

Android :: Detect OnTouch For Widget?

Oct 2, 2009

I'm trying to make widget gallery at homescreen. I'm currently stuck because didn't find any example how to detect on touch in widget. Could someone help me?

View 5 Replies View Related

Android : Detect Fling Action In Own Widget?

Mar 18, 2009

how can I detect Fling action in my own widget? I have implemented my widget as OnGestureListener.

And like in Gallery, I have a "GestureDetector mGestureDetector = new GestureDetector(this);"

For my onTouchEvent(), I have @Override public boolean onTouchEvent(MotionEvent event) {
// Give everything to the gesture detector boolean retValue = mGestureDetector.onTouchEvent(event); return retValue;

But my public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) is never get claeed.

View 3 Replies View Related

Android :: Detect Widget Active In Current Panel?

Nov 6, 2009

how to detect the Widget in home screen is active in the current panel? As you know, some device has many panel i.e (HTC Hero has 7 panel), each panel can put some widgets on the home screen, then the widget will run and refresh the data automatically, we want to let the widget disable the refresh data feature while it is not under current panel. and enable it while it is put to current panel again.

View 7 Replies View Related

Android :: Method To Detect Widget Is Visible - Foreground Or Background?

Aug 6, 2009

It would appear on a G1 (with the latest software update) that onUpdate () runs even when the widget is not visible. Is there a way of sensing that the widget is or is not visible or is otherwise in foreground? That is, running the code below shows a logcat message at whatever interval the Widget is scheduled to update, whether it's in foreground or not, whether even the screen is dim or otherwise in deep sleep. It would seem onUpdate should only be scheduled to run when the Widget is in the foreground or visible. Is this a defect in the G1, or is there some other API call to detect if the Widget is visible?

public class HomeScreenWidget extends AppWidgetProvider { ...

View 2 Replies View Related

Android :: How To Detect Orientation Change In Home Screen Widget?

Mar 15, 2010

I am writing a home screen widget and want to update (modify) the home screen widget when the device orientation changes from portrait to landscape or the other way. How can I make it? Currently, I tried to register to CONFIGURATION_CHANGED action like the code below ...

View 3 Replies View Related

Android :: Button Click Lost On Widget When Screen Rotated

Nov 22, 2010

I have a very simple widget application which consists of a linear layout with a background and an image button. In the AppWidgetProvider on Update method, I register the click of the button to broadcast an intent. When the widget first loads, everything runs fine and the click is captured. The problem occurs when the screen is rotated, and the click is never captured again even if the screen is rotated back. What do I have to do to re-register the click when the screen rotates? below is some segments of code I am using.
AppWidgetProvider
@Override
public void on Receive(Context context, Intent intent)
{super.on Receive(context, intent);
if(intent.getAction().equals("test.CLICK"))
{Closemouthed(context);}}
@Override
public void on Update(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds)final int N = appWidgetIds.length;
// Perform this loop procedure for each App Widget that belongs to this provider for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i]; RemoteViews views=new RemoteViews(context.getPackageName(), R.layout.widget);
Intent click intent=new Intent("test.CLICK");
Pending Intent pendingIntentClick=Pending Intent.getBroadcast(context, 0, click intent, Pending Intent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.change_mode, pendingIntentClick);
SetInitialLayout(context);
appWidgetManager.updateAppWidget(appWidgetId, views);}
super.on Update(context, appWidgetManager, appWidgetIds);}
Manifest
<receiver android:name=".Widget" android:label="@string/widget_name">
<intent-filter>
<action android:name="android.appwidget.action.ACTION_APPWIDGET_CONFIGURE" />
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="test.CLICK" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_mode_switcher" />
</receiver

View 3 Replies View Related

Android :: Lost Home Widget / Need Back - Time / Temp This Is?

Jun 18, 2010

Anybody know what time/temp widget this is? I removed it while playing around and can't seem to find it in the widget list.

View 1 Replies View Related

Motorola Droid X :: Auto Focus - Click To Focus

Aug 29, 2010

I loved the camera on the Eris and the Incredible, not only did they have a whole lot more of a crisp high-res detail, the auto-focus absolutely rocked. With my droid x, I can be getting a little artsy and focus on an object with the crosshair but it'll take me 20 tries to get it to lock on, its insane, I know I'm not getting too close to my subject because it will definitely eventually focus on that object if I try over and over and over again. It's not just close ups that I find myself and my buddy with this issue either. macro shooting mode does not help. My buddie's droid X has the same exact behaviors. Eris and incredible just LOCKED ON first try with even very low contrast / detail subjects, on top of that, have a ton better camera GUI when it comes to "click to focus". I know this thing ain't no SLR but, blows me away of how terrible the camera performance is vs. the HTC android based devices. Ihink motorola will fix this? I know this thing ain't no SLR but it just blows me away how the HTC android devices camera performance (except for video) blows the Droid X away.

View 9 Replies View Related

HTC Desire :: Lost Couple Of Pictures From People Widget

Aug 5, 2010

I have lost a couple of pictures from the people widget yet the photos have not been deleted from the phone.When I view the relevant contacts in people or receive a text then the relevant photo appears at the side of the contact but not in the widget.

View 1 Replies View Related

HTC Incredible :: Time And Weather Widget Lost / Get Them Back?

Jun 26, 2010

How do I get back my time and weather widget that is on my home screen? I lost it and can't find it. The HTC didital clock with weather widget that came with the phone just disappeared.

View 1 Replies View Related

Android :: Focus Not Going To Another Button

Jun 9, 2010

I wrote a code for pinging of given URL.It works fine for me.But whenever i clicked on the start ping button, pinging started but that time focus always is on start button and no widget of the screen working that time. After pressing many times it will gives the force close error.If iam giving URL which is not pinging then that time , all the widgets are working fine.After some time i need to stop the pinging by using my stop button.But it is not working.Please give me advise.Iam using Runtime.exec() for ping command in my android.

View 2 Replies View Related

Android : How To Set Focus On List?

Sep 9, 2010

I display a list on screen, how could I set focus on one list item? It seems in touch mode, it is impossible to set focus. Am I correct?

View 2 Replies View Related

Android :: Next Focus And Soft Keyboard

Apr 24, 2009

I have a form that is working fine with the "Next" flow order when using the computer keyboard with emulator (and probably with the keyboard on the G1) but not with the SoftKeyboard with 1.5.Some fields indicate "Next" with this keyboard, some go to the correct field and others don't.Two of the fields are text and they only give a carriage return instead of "Next."My numeric fields give the proper "Next" key. Use of the SoftKeyboard is a little underdocumented so far (if there is a hidden doc online somewhere please provide me a link to it). There are also some added fields under 1.5 that I have asked about previously but received no answer.These appear to have something to do with the Soft Keyboard.Though these can be set programmatically I haven't seen the proper way to set these flags using XML. This field is the one that replaces "Numeric" which deprecated.

View 3 Replies View Related

Android :: How To Prevent EditText From Getting Focus?

Feb 15, 2010

How can we prevent an edittext from getting focus and displaying the soft keyboard. I have an searchbox which should not be focused by default and should have focus only when user clicks on it to enter something. But right now it takes focus and shows the keyoard as soon as I open the activity. Is this a bug or can this be changed to behave in the way we want?

View 2 Replies View Related

Android :: Newline Characters And Focus

Aug 17, 2010

Currently I have an edittext field that when the user presses enter it does mostly what I want it to, validate an IP Address format and inform the user if it is wrong. How do I make it so when the user presses enter it checks it like it is supposed to be does not enter the newline character?

Here is my code for it.
public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
if(validateIPaddress(m_etIPAddress.getText().toString())){
ConfigData.m_IPAddress = m_etIPAddress.getText().toString();
} else { showAlertDialog("Invalid IP Address
Example: 255.255.255.255 0.0.0.0","Error: ");
m_etIPAddress.setText(ConfigData.m_IPAddress);
m_etIPAddress.requestFocus();
} return false;
}

Another problem I have is that in the false condition of the validation, that it will not bring up the soft keyboard to allow the user to reedit that text field. If the user clicks on another edit text the window gives it focus, and allows the user to edit the second text field while still maintaining the 'green outline' around the original edittext.

The EditText still creates a newline. I tried calling that when I create the EditText and it shows the dialog then inserts a newline character at the beginning which is weird because the
m_etIPAddress.setText(ConfigData.m_IPAddress);
Should automatically overwrite anything in that field to the static IP saved within ConfigData. (my settings class) and I think the focus might work, the problem is that after requestFocus, that EditText shows it has focus but is unresponsive. I can click on other EditText's and modify them, while it still shows the focus outline on the IP EditText. If I click on the IP EditText it doesn't actually do anything. Its kind of strange.

View 1 Replies View Related

Android :: Set Focus On Running Activity

Mar 24, 2010

I have an Activity that keeps running after the Home button is pressed (naturally) and of-course the focus is in the home screen, and when the running process ends I need to restore the focus on that activity. In more PC expression, I need to maximize the application.

View 1 Replies View Related

Android :: AutoCompleteTextView - Passing Focus And 1.6

Nov 15, 2009

Has anyone noticed that AutoCompleteTextView doesn't pass the focus to the next field when you tap on "NEXT" button on soft keyboard? And it's all happening on Android 1.6. v1.5 works flawlessly! Is there any known solution for this?

View 3 Replies View Related

Android :: Recruiting For Focus Group

Jun 23, 2010

I am taking a marketing research class and our topic is on smartphones. We need to do a focus group for this project and the report is due VERY soon. We had much difficulty finding people with android phones here in vancouver so it would be much appreciated if you guys can help! The focus group will likely take place on msn either on Friday or Saturday around 5pm. If you are not available for a focus group, I can always interview you individually through skype/msn/phone/email. You can contact me at my email: mmi@sfu.ca or reply to this thread!

View 6 Replies View Related

Android :: Set Initial Focus In Application

Apr 30, 2010

In my android application it automatically focuses the first Button I have in my layout, giving it an orange outline. How can I set the initial focus preferably in XML, and can this be set to nothing?

View 1 Replies View Related

Android :: Set Focus On Any Item Of Listview

Jul 2, 2010

Now i want the first item of the list to be automatically focused when i launch the application How can i set the focus on any item of the list when i click on the some other view for example a button?

View 1 Replies View Related

Android :: Focus The Developer Emulator?

Aug 3, 2010

I made an image button in eclipse and I tested it out (ran it) with the emulator in the android sdk package.

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/cat1" /> <!-- pressed -->
<item android:state_focused="true"
android:drawable="@drawable/cat2" /> <!-- focused -->
<item android:drawable="@drawable/cat3" /> <!-- default -->
</selector>

Pressed and Default work with the mouse, but how do you focus it? Or if you can't, do you need to get an android phone?

View 1 Replies View Related

Android :: Get Focus To GridView First Image?

Aug 25, 2010

Iam writing GridView by using BaseAdapter with 2 columns.Each column with One Image and Text.It works smoothly.I had given focus by using below code in onConfig...

public void onConfigurationChanged(Configuration newConfig) {
gridview.requestFocusFromTouch();
gridview.setSelection(0);
}

It works when my view configuration changes.But Same doesn't work in onCreate() method.I used below all methods in onCreate() but my view doesn;t get focus.How to give focus for the first image when running my application.I want focus on first image when view inflates on the device.Please give me guidance?................

View 1 Replies View Related

Android :: Regaining Focus Using SurfaceView

Mar 23, 2009

I'm currently getting to grips with Android, playing around with the Lunar Lander sample. I've found that if you navigate away from the app (eg, hit the call button) it will destroy the underlying surface (calling surfaceDestroyed). Navigating back (which will trigger onWindowVisibilityChanged) the app will crash, as it will try to draw to the surface without recreating it. Is there some code I can put in onWindowVisibilityChanged (or anywhere else) that will regenerate the SurfaceView's underlying surface and resume execution nicely? It feels like this should be a simple function call but I can't find anything in the API docs.

View 2 Replies View Related







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