• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Spinner's currently selected item is repeatedly selected

I would like to have the event occur even when the Spinner's currently selected item is repeatedly selected. For example, if 0 is selected and 0 is selected again, I want to make the event fly again.


```
public class MySpinner extends Spinner{

OnItemSelectedListener listener;

public MySpinner(Context context, AttributeSet attrs)
{
super(context, attrs);
}

@override
public void setSelection(int position)
{
super.setSelection(position);

if (position == getSelectedItemPosition())
{
listener.onItemSelected(null, null, position, 0);
}
}

public void setOnItemSelectedListener(OnItemSelectedListener listener)
{
this.listener = listener;
}
}
```

I used this code to define an extension class. How do you apply this to your existing Spinner?

Below is the current source.

```
public static TextView mTXT_DRS4DL, mTXT_DRS4D_NXT;
public static Spinner mSPI_DRS4DL, mSPI_DRS4D_NXT;
public static ArrayList<String> mLIST_DRS4DL, mLIST_DRS4D_NXT;
public static ArrayAdapter<String> mADAPTER_DRS4DL, mADAPTER_DRS4D_NXT;
private static boolean isFirstSelected = true;
private static String mCheckString = "";

{

mSPI_DRS4DL = PlatMainActivity.instance.findViewById(R.id.spi_DRS4DL);
mLIST_DRS4DL = new ArrayList( Arrays.asList());
mADAPTER_DRS4DL = new ArrayAdapter<>(PlatMainActivity.instance, R.layout.support_simple_spinner_dropdown_item, mLIST_DRS4DL);
mSPI_DRS4DL.setAdapter(mADAPTER_DRS4DL);

mSPI_DRS4D_NXT = PlatMainActivity.instance.findViewById(R.id.spi_DRS4D_NXT);
mLIST_DRS4D_NXT = new ArrayList( Arrays.asList());
mADAPTER_DRS4D_NXT = new ArrayAdapter<>(PlatMainActivity.instance, R.layout.support_simple_spinner_dropdown_item, mLIST_DRS4D_NXT);
mSPI_DRS4D_NXT.setAdapter(mADAPTER_DRS4D_NXT);
}
```

```
public static void Search(String mSearch)
{
String mRemoveName;

if(mSearch.contains("DRS4DL")) {
mRemoveName = mSensorSearch.replaceAll(":DRS4DL", "");
mADAPTER_DRS4DL.add(mRemoveSensorName);
mADAPTER_DRS4DL.notifyDataSetChanged();
}
else if(mSearch.contains("DRS4D-NXT")) {
mRemoveName = mSensorSearch.replaceAll(":DRS4D-NXT", "");
mADAPTER_DRS4D_NXT.add(mRemoveSensorName);
mADAPTER_DRS4D_NXT.notifyDataSetChanged();
}
}
```

```
public static void SensorSpinnerEvent()
{
mSPI_DRS4DL.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {

//AbstractDataInterface.SendCmdMessage(mMessage, AbstractDataInterface.SEND_TO_DATA, PlatCmdMessage.MsgTouch.Req.SelRadar, 0);
}

@override
public void onNothingSelected(AdapterView<?> parent) {

}
});

mSPI_DRS4D_NXT.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {

if(isFirstSelected)
{
isFirstSelected = false;
} else {
switch (position) {
case 0:
mCheckString = mLIST_DRS4D_NXT.get(0);
Log.e("LOG", "---------------------------------------------------->> DRS4D_NXT Check String : " + mCheckString);
break;

case 1:
mCheckString = mLIST_DRS4D_NXT.get(1);
Log.e("LOG", "---------------------------------------------------->> DRS4D_NXT Check String : " + mCheckString);
break;

case 2:
mCheckString = mLIST_DRS4D_NXT.get(2);
Log.e("LOG", "---------------------------------------------------->> DRS4D_NXT Check String : " + mCheckString);
break;
}
}
}

@override
public void onNothingSelected(AdapterView<?> parent) {

}
});
}
```

How to auto backup phone before it is faulty or lost?

I want to be prepared so if one day my android phone is lost or faulty, I can just buy a new phone to recover all the data and make the new phone to have everything like the old phone (sms history/whatsapp/telegram/call/messages history/app settings/photos...)

What are the steps to properly backup everything?

If possible, I would prefer to set and forget, something like auto-scheduled backup.

I do not want to root the phone.

Thanks.

Can you rely on midrange soc for few years.

Im planning to buy a new phone with snapdragon 730, and that soc is the most powerful midrange in 2019. People saying you wont notice the difference when playing graphical games on max setting when compared to flagship, youll only notice few seconds slower loading time. 700 chips is also far power efficient making them better experience. Can you rely on it for about 4 years just like flagships especially for graphical games?

Bluetooth Headset

While using Bluetooth headphones with the accessability settings turned on it seems that the sound comes out of the phone as well at the same time. I would like to keep this from happening, I'm visually impaired so it also speaksmy text messages out loud. Am I missing a setting to go to headphones only when they are connected?

International number not picked up by WhatsApp

Hi,

I'm having some trouble with WhatsApp.

I am trying to add a friend from Ukraine. I am currently in Canada but I still log in to WhatsApp using my British phone number, on my British bought Samsung S7.

I already know about adding + and country codes etc.

I saved my Ukrainian friends number into my phone contacts list. It does not show up in Whatsapp. He definitely has the app.

He told me his number starts with +38, but online I read the country code is +380. I have tried using both codes and tried many combinations of his number. WhatsApp does not pick up the number.

How do you get WhatsApp to pick up a Ukrainian number?

Thanks,
Kai

Ported GamerROM Eclipse to the Nexus 6P to the Nexus 6P, but having vendor problems...any help?

So i ported GRE to the Nexus 6P however it installs fine but wifi inst working, i know it coukd be a vendor mismatch, but i have an idea and wonder if it will work

show_progress(0.050000, 5);
package_extract_file("vendor.img", "/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor);
show_progress(0.200000, 10);
set_progress(1.000000);

HELP

Is there anyway to prove where i really was on google maps?
Example: i stopped at three places (counting the stop signs) and my time line shows serveral stops not even on any road, just shoots me accros the town i was in. Need to prove this for my own piece of mind.

Help I can't get my Alcatel One touch to back up to google

Alcatel One touch back up to google for restore to Motorola G7 Play? I have done everything I have read in the manuals and nothing seems to work.I just bought an unlocked Motorola G7 Play new from Best buy and ran the program it pops up to copy all the data over from my other phone. It all looked like it was running well but when it was all said and done about all that came over was my phone contacts. No pictures, no messages, no calendar stuff. The main reason I bought another android was so I could copy this stuff all over. I was told it was a simple process but you have to figure in that I am an old guy and the phones are smarter than I am.

Screen times out

I have a Huawei BTV-W09 tablet. The problem is, it will go to a black screen with only 30 seconds. I have went to Settings/display/sleep. It is set to 30 seconds, but when I try to press or tap the screen it will not show the drop down menu, with the additional choices, ?

HELP! Phone stuck at boot screen. I need help ASAP

I tried to root my phone for the first time.
I booted into TWRP and installed SuperSU and TWRP, then my phone rebooted.
When I try to reboot it or turn it off it does the following :
it starts booting up, then after a second it reboots again, then flashes the boot screen and repeats this a couple times until it gets stuck on the boot screen.

My phone is a LG G6 (h870) ThinQ.
Android version 8.0.0.

Everything I did prior to this :
unlocked my bootloader and that reset my phone,
after that I accidentaly wiped it again using the hard reset option (while booting holding the power button and volume down button),
then i booted into TWRP again and installed SuperSU.

This is what I followed after unlocking my bootloader : https://www.androidblog.gs/how-to-root-lg-g6-and-install-twrp-recovery-on-it/

Device Administrator

So my company just switched over from Gmail to Outlook. I'm the manager of my department and we've been given the option to add the Exchange accounts on our personal mobile devices. I have successfully added multiple android (newer devices) users accounts without any issues.

Following the steps &gt; Add account &gt; exchange activesync &gt; manually input correct info &gt; grant permission for device administrator and all checks out fine for them..

My problem is whenever I follow these same steps, I never get the popup to grant device administrator privileges and it ends with going to the email app and no sync. Our IT department is hardcore Apple and not much help.

So far, if tried every possible setting I can think of even did a factory reset and tried the same before installing non-core apps. I've had an exchange account previously from another email account soni knowing will work.

Any idea?

Galaxy Note 9 - stock.

  • Locked
spying apps

can any one suggest me a spying apps which can be downloaded and installed remotely in the target mobile...i am having the gmail account and password of the target person and i dont want to know him that i am spying on him.

the apps so far i could found on google are useless. because i believe if the targeted person knows that we are installing something to their devices and if we are asking them for the permissions, i i believe the purpuse behind the spying is dead.

even google family link app is useless in my view point.

if we are telling the person whom we wana spy, than its not a spy

Spider, man

Check out this cool little jumping (I think) spider. I did not take these photos. I have no access to an Iphone X costing $1200. Why can't Android have such a good camera? Anyway, it's a small spider, not nearly palm size. It reminds me of a tarantula. I wonder why it's green around the mouth, to attract mates and/or intimidate rivals? There's probably no way to tell even with these great pictures if it's male or female.

Attachments

  • Screenshot_2019-06-08-12-07-16.jpg
    Screenshot_2019-06-08-12-07-16.jpg
    234.5 KB · Views: 133
  • Screenshot_2019-06-08-12-07-02.jpg
    Screenshot_2019-06-08-12-07-02.jpg
    268.5 KB · Views: 106

Apps How should I code this?

I want to implement this “Block” so that it reflects information from a database.

When the user scrolls down it must repeat, so that the data per “Person” in the database can be reflected onto one single block.


How can I make it that the block repeats itself?
- If you have any resrouces for me to read on this topic please link them below. I am NOT asking for you to write my code. I am just asking for tips on how to do this the most efficient way.
- Can I group the design of this "block" into a block so that when there are more records that it will take this block and put the data on the "block".

Attachments

  • Panel X W-O Social Media Buttons – 5.png
    Panel X W-O Social Media Buttons – 5.png
    44 KB · Views: 67

Help Identifying Game

Hello everyone,

Just wondering if anyone could help me identify a game?

It kept coming up as an advert whilst I was playing WordLink. It had a cartoon style horse in a damaged shed and a tree on fire next to it, viewed isometrically. The instruction was to stop the horse from bolting by dragging equipment from the bottom toolbar onto the picture to interact with it; ie: a bucket of water onto the tree on fire to put it out for example.

Anyway I've tried Google, tried the Playstore, tried searching this forum, tried playing WordLink to see if the advert came up again, all to no avail. Anyone have any idea what game it is? Gardenscapes kept coming up but that doesn't seem to be it...

Thanks,

Pete.

Filter

Back
Top Bottom