android-widget

Android widget List view showing same content for every item

泪湿孤枕 提交于 2019-12-10 10:42:50
问题 I am trying to implement listView widget by using data returned from firebase. But for every item in listview I only see the first data row from firebase and I am not able to figure out why. i tried debugging I am getting unique data in datasnapshot My code is Widgetservice.java public class WidgetService extends RemoteViewsService { @Override public RemoteViewsFactory onGetViewFactory(Intent intent) { int appWidgetId = intent.getIntExtra( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager

Android: Is there a method equivalent to XML android:digits?

核能气质少年 提交于 2019-12-10 10:36:44
问题 In my layout xml, I use the following to define an EditText that can display currency. <EditText android:id="@+id/et1" android:layout_width="210dp" android:layout_height="wrap_content" android:imeOptions= "actionNext" android:inputType="phone" android:digits="0123456789.,$" > However, this is not localized. I want to be able to use the symbol returned by NumberFormat.getCurrencyInstance().getCurrency().getSymbol(); in place of the $ in android:digits . What I don't know is how to set android

How to use OnTabChangeListener?

久未见 提交于 2019-12-10 10:30:02
问题 I have an android program with 3 tabs. When I click on the “Map Tab” I want it to display “Map is Selected” message as shown in the picture bellow. But if I click on “Name” tab and then come back to the “Map Tab” the second time, the “Map is Selected Again” message wouldn’t show up in the screen. How can I make the “Map” tab display “Map is Selected Again” message each time I choose that tab? Can you edit the following code and show with an example about how to use OnTabChangeListener? public

Why should I use RemoteViews for Android home screen widgets?

本小妞迷上赌 提交于 2019-12-10 10:18:52
问题 I'm trying to realize an Android home screen widget. I am interested to know why I should use RemoteViews in implementing widgets? 回答1: Refer this link site. Creating the App Widget layout is simple if you're familiar with Declaring Layout in XML. However, you must be aware that App Widget layouts are based on RemoteViews, which do not support every kind of layout or view widget. A RemoteViews object (and, consequently, an App Widget) can support the following layout classes: FrameLayout

Creating Gestures in android

旧街凉风 提交于 2019-12-10 09:57:30
问题 Hi i am following this tutorial http://www.vogella.de/articles/AndroidGestures/article.html i want to create an application in which user can add his gesture inmy application and then use it for authentication.i know using this code i can check whether gesture entered by him is correct or not. package de.vogella.android.gestures; import java.util.ArrayList; public class GestureTest extends Activity implements OnGesturePerformedListener { private GestureLibrary gestureLib; /** Called when the

how to launch activity after widget button is pressed?

泪湿孤枕 提交于 2019-12-10 09:25:27
问题 Following this tutorial I quickly created a simple widget which displays the current time on the home screen: I've modified the code so that the widget also comes with a button. My goal is to launch an activity, once the button get's pressed. Unfortunately, I do not really understand where to listen to the button click. Does this have to go into the broadcast receiver section of the manifest file? <!-- Broadcast Receiver --> <receiver android:name=".WifiSSIDWidget" android:label="@string/app

Center text items in ListView

柔情痞子 提交于 2019-12-10 05:31:32
问题 How can I horizontally center-align text items of the ListView in my Layout ? Honestly, I googled for at least an hour before asking such a basic question. Thanks. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <EditText android:layout_width="match_parent" android:layout_height="50dp"

Sending Intent inside of another Intent

半世苍凉 提交于 2019-12-10 05:10:39
问题 Perhaps I am going about this the wrong way, but I want to respond to my Android AppWidget's click event within my own app AND launch an Activity. At the time I set the PendingIntent I have another Intent which I want to launch when clicked. My onStartCommand uses this line: final Intent mLaunchIntent = (Intent) intent.getParcelableExtra(Widget.EXTRA_INTENT); When I call setOnClickPendingIntent I have this line prior: mSendingIntent.putExtra(Widget.EXTRA_INTENT, (Parcelable) mLaunchIntent);

Widget onUpdate, onReceive

大城市里の小女人 提交于 2019-12-10 04:35:56
问题 I initialize some arrays in an onUpdate() method and after that, using an intent and a button, I try to call onReceive() function which runs fine but cannot access arrays set in onUpdate() method. Why is that? Those array's are object variables and are declared public. Am I missing something? package net.aerosoftware.widgettest; import java.util.HashMap; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android

Integration of my widget with my application

不打扰是莪最后的温柔 提交于 2019-12-10 04:21:33
问题 I have made a widget that is working fine on its part and also i have made and app for that is working well too in its part. Now i want to integrate this widget into my application such that both are under same package. how can i do this ?? do i have to make changes in manifest file. I have done R&D but all links are for developing the widget from the start..none is on integration. i have seen alot but found nothing helpful. Please help me in this regard. Thanks in advance. 回答1: It work for