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

Listview updating item issues

I've solved both issues. Actually found that the String value that I was using to select my icon in my arrayadapter was appearantly getting a string with an extra space in it from the return data. This caused my ImgID variable that I was using to set the image to default to ic_launcher (which I set as default icon for testing). I changed the cat == "VALUE" to a cat.contains("VALUE") to avoid this issue.

Java:
        int imgID = R.drawable.ic_launcher_background;
        String cat = data.getCategory().toUpperCase();
        if (cat.contains ("MAINTENANCE")) {
            imgID = R.drawable.icon_engine;
        } else if (cat.contains ("DOCUMENT")) {
            imgID = R.drawable.icon_docs;
        } else if (cat.contains ("FUEL")) {
            imgID = R.drawable.icon_fuel;
        } else if (cat.contains ("DRIVING")) {
            imgID = R.drawable.icon_steeringwheel;
        } else if (cat.contains ("BUSINESS")) {
            imgID = R.drawable.icon_taxi;
        }

As for updating the Listview Item I stripped most of my code out of the above code and simply created a new itemData using the returned data.

Java:
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 501 && resultCode == RESULT_OK) {

            DecimalFormat f = new DecimalFormat("000,000");

            int locid = data.getIntExtra("locationid", 1);
            int id = data.getIntExtra("id", -1);
            int pos = data.getIntExtra("position", -1);
            int mil = data.getIntExtra("mileage", 0);
            double cos = data.getDoubleExtra("cost", 0);
            String typ = data.getStringExtra("type");
            String tit = data.getStringExtra("title");
            String des = data.getStringExtra("description");
            String dat = data.getStringExtra("date");

            LocalDateTime lt = convert.DateTimeFromString(dat);

            items[ItemPosition] = new itemData(id, des, mil, cos, "", typ, 1, 1, lt);
            mAdapter.notifyDataSetChanged();
        }
    }

My ItemPosition variable stores the value of the item clicked on in the listview onclicklistener so that when a result is returned I can get the actual item that was clicked to edit. mAdapter.notifyDataSetChanged() does update the entire view after the original data has been modified. My issues were self-inflicted with the string comparison and not properly updating the original data. Live and learn, right?
You should compare String using stringA.equals(stringB) instead of use stringA.contains(stringB).
At the time I begin learn Android, I got very much issues too.

How To How to Screen Record

Wow, I didn't know I could actually record the screen of my phone with so many options (especially this one: Media sounds/Media sounds and mic). I thought that I can do something like that only if I record my pc screen. By the way, I used to do that when I was playing csgo with my buddies and posting these videos on youtube. If someone wants to find out how to do that on pc read the info on this site.

Voice notes

I found that Samsung has the Samsung Voice Recorder. It works fairly simply, although there is no simple way to transfer the MP4 files to the computer because the newer Androids apparently no longer support MSC (mass storage class, that is generic file system connection), only MTP/PTP (media transfer protocol). But that got me halfway there.

Android phone setup and Google sign-in

HI. So Sigining into Google Playstore (in 2015 with Android 4.0 or 5.0) .. did sign into all google accounts??
Wow...i really dont remember that occurring...
I recall signing into google play and then still having to sign into google drive and google photos etc..

Back then, many apps would work without Services installed on the device.

Also, if you ever go to individual Google 'apps' via your browser for the first time, without being signed in to Google with that browser- same thing.

Problem with Uber app

its more likely a problem with the app on your phone and not the phone itself. there really is not much else you can do, other then wait for uber's dev team to contact you. its most likely that there is an issue within the app that is not working specifically with your phone. not all phones are the same, so devs have to adjust the app specifically to each phone out there, so there just maybe only issue with your specific phone model.

Help Pawnshop

i'm a tad confused. what do you mean by "mailbox"? are you saying after the hard reset your facebook account was still live? if so then you did not perform the hard reset correctly. just do a factory reset within your phone's settings. it will return to the phone as new and you should be fine. all of your stored passwords will be wiped clean so you do not have to worry about those.

Help Firewall app for Android 4.4.2 - Solved

I found a newer custom ROM. CM11. I found 3 versions of that for my device and all were flashed normally. One of them is the same as my device which is Android 4.4.2 and the firewall did not work well on it either. It was the same as on the stock ROM. Nothing newer is available for this device.

The others were 4.4.4 and the firewall worked perfectly on it. I used the latest compatible AFWall+ on it which is 2.9.9 .

In conclusion. Firewall apps do not seem to operate well on Android that is older than 4.4.4 .

This thread is closed.

Filter

Back
Top Bottom