Hello!
I have a little problem.
I had EditText filter, Array List(with Listview), and every position from list is opening new Activity(with some text) by "if(position==0,1,2,3...)"
But when i search with filter some text, and single rows are changing position after search, Activity called "Chicken" is geting a wrong String(from String.xml)
I know the problem is cause i use "if" with position, but i dont know how to solve that.
I don't even know what i should write to uncle google, Please help
using viewholder?
Use view.setTag(someText) on every list item
Then when it is clicked call getTag() to get the string you should pass to the activity
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Maybe the problem you don't clear filtered list whenever you add new letter to EditText ??
if so, Use filteredList.clear(); once the text changed.
You have to call notify() on the listview or in the ListView adaper to tell the list that changes have been done.
GeknGekn said:
You have to call notify() on the listview or in the ListView adaper to tell the list that changes have been done.
Click to expand...
Click to collapse
I'm not sure whether notify() will work as well, I only know of notifyDatasetChanged(), which I already tested
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Related
Does anyone know if it's possible to mod the Stock Froyo lockscreen to enable access to the notification bar (check notifications from lockscreen)? I know widget locker does this but was wondering if I could edit a system file (android.policy.jar maybe?) to enable this.
I would like to know as well. Love your rom by the way Geo.
I think you're looking for
frameworks/policies/base/phone/com/android/internal/policy/impl/KeyguardViewMediator.java specifically:
Code:
private void adjustStatusBarLocked() {
...
// if the keyguard is shown, allow the status bar to open
// only if the keyguard is insecure and is covered by another window
boolean enable = !mShowing || (mHidden && !isSecure());
mStatusBarManager.disable(enable ?
StatusBarManager.DISABLE_NONE :
StatusBarManager.DISABLE_EXPAND);
navillos said:
I would like to know as well. Love your rom by the way Geo.
Click to expand...
Click to collapse
Thanks
[email protected] said:
I think you're looking for
frameworks/policies/base/phone/com/android/internal/policy/impl/KeyguardViewMediator.java specifically:
Code:
private void adjustStatusBarLocked() {
...
// if the keyguard is shown, allow the status bar to open
// only if the keyguard is insecure and is covered by another window
boolean enable = !mShowing || (mHidden && !isSecure());
mStatusBarManager.disable(enable ?
StatusBarManager.DISABLE_NONE :
StatusBarManager.DISABLE_EXPAND);
Click to expand...
Click to collapse
Can I edit pre-existing files or does this have to compiled from source? I really haven't built from source but this may be the thing that gets me started.
relating to this, does anyone know how to disable the power button while lock screen is on?
hi,
is there any way to set the sim pin by my applikation?
we don't want our customers to know the sim pin, so our applikation will know it (encrypted config file). if the device needs the sim pin, it shouldn't prompt the user for a sim pin. my application should set it for the user.
Maybe the following code would be helpful for you:
Code:
TelephonyManager tm =
(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
Class clazz = Class.forName(tm.getClass().getName());
Method m = clazz.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony it = (ITelephony) m.invoke(tm);
it.supplyPin("1111");
Please keep in mind that you also need ITelephony.aidl from Android sources.
rwxer said:
Maybe the following code would be helpful for you:
Code:
TelephonyManager tm =
(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
Class clazz = Class.forName(tm.getClass().getName());
Method m = clazz.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony it = (ITelephony) m.invoke(tm);
it.supplyPin("1111");
Please keep in mind that you also need ITelephony.aidl from Android sources.
Click to expand...
Click to collapse
thank you very much.
can you please tell me, where to get the right ITelephony.aidl? i tried searching in my sdk folder, but didn't found anything. google found a couple of different versions. what should i do exactly with the aidl file?
bassmaster said:
thank you very much.
can you please tell me, where to get the right ITelephony.aidl? i tried searching in my sdk folder, but didn't found anything. google found a couple of different versions.
Click to expand...
Click to collapse
I used aidl from source repository http://android.git.kernel.org/ , version 2.2. You can try the one you found.
bassmaster said:
what should i do exactly with the aidl file?
Click to expand...
Click to collapse
Did you try to google?
http://developer.android.com/guide/developing/tools/aidl.html
Place ITelephony.aidl in package com.android.internal.telephony in your source dir. After that java classes should be generated from .aidl files and compiled if you're using standard build script.
I added “ITelephony.aidl” and the code to my app. It all works fine. Thank you.
But now I have the following problem:
My App starts within the device. While booting, the sim pin dialog request appears. This screen is blocking everything - including the start of my app.
How can I avoid that?
The only workaround known to me is to do the following:
I enabled the flight mode before I shut down the device. After reboot my app starts, disables the flight mode and sets the pin.
But I don't know an efficient way that always starts the device in flight mode.
Can you help me please?
You can try to handle android.intent.action.BOOT_COMPLETED intent (see example http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/) and provide sim pin code just after boot. Don't forget to add permission android.permission.RECEIVE_BOOT_COMPLETED
I'm quite a beginner in the android world, so forgive me for any trivialities. I've developed a small android-app using Android-SDK and Eclipse-ADT that maintains information in an sqlite database. Now, there is a simple activity that reads product information from the sqlite db and updates the editbox controls. But one of the information is an image-location for that product (typically '/mnt/sdcard/something.jpg'). I use an ImageView control to display this image as described in the Android API:
img.setImageBitmap(BitmapFactory.decodeFile(c.getString(2)));
This works well on all android devices and emulators I've tested on, except one - on my particular device (Karbonn A30), the imageview is just blank, it doesn't show up anything!!
Hello,
I am facing the same issue on my ASUS device. On the emulated and Sony device it works fine.
To be sure that the file exists I have build in a Toast message that confirms that file exists on SD-card.
But the ImageView remain blank on the ASUS 300 TFT device.
Have you figured out what the issue is?
When I refer to an image on in the res-folder, then it is displayed.
Are you getting the image from SD card? If so, how are you retrieving the path to the image? Android devices vary greatly on how they handle external storage and their respective paths. What android version are the devices you're testing on?
______________________
Root it and boot it!
Current device: Sm-n900p/Sprint Note 3
ROM:AICP ROM
Service: Straight Talk
Check out my apps on Google Play
Hello,
I am using the android API's to access the pictures, like:
File externalDir = new File(Environment.getExternalStorageDirectory(), dir);
File mydir = this.getDir(dir, Context.MODE_PRIVATE);
I have tried it both for internal and external and external storage.
I have even build in a check to see if the image really exists (showing a positive result in a Toast-message).
I think it might be related to the size of the image.
If it is too big, would I need to resize it first to be able to display it?
Hi, I'm developing a bug-report function in my app and I want to take a screenshot but I first need to hide the navigation drawer in the code.
I wrote and tested the functions to do such things but when I put them together what I get is a screenshot with the drawer open! Here's the code:
Code:
//I call the android drawerLayout method to close it
mDrawerLayout.closeDrawer(Gravity.START);
// and that's how I take the screenshot
public static Bitmap screenShot(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),
Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}
It's like I need to wait some ms to let the drawer close and then take the screenshot. Any ideas?
Do you have a DrawerToggle integrated in your code? It has an onDrawerClosed method which should be called when the drawer is completely closed. So you could set a field variable to true if a screenshot should be taken and inside the onDrawerClosed you check this variable and if needed call your screenShot method.
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
This method works but I don't like it because I think that using field variables in that way dirty the code. I'm still searching for a better solution but thank you Masrepus! =)
Sent from my GT-I8730 using XDA Free mobile app
I found the following link 'https://github.com/chiralcode/Android-Color-Picker'. I copied `ColorPicker.java' and `ColorPickerDialog.java' . I've been trying to make that dialog box appear somehow .. but I still can't figure it out. If you run the initial app you can see that it has a color picker dialog button (when you press it that window appears). How can I make something like that?
I tried using this(as he says on that website) :
ColorPickerDialog colorPickerDialog = new ColorPickerDialog(this, initialColor, new OnColorSelectedListener() {
@override
public void onColorSelected(int color) {
// do action
}
});
colorPickerDialog.show();
but I get a lot of errors. I only copied those 2 java files, nothing else. Not even the layout or something like that. What else should I copy in order to make it work ? I'm using Android Studio
I've been trying to solve this for a long time .. but however I try I won't get it done. Thank you
iDaniel19 said:
I found the following link 'https://github.com/chiralcode/Android-Color-Picker'. I copied `ColorPicker.java' and `ColorPickerDialog.java' . I've been trying to make that dialog box appear somehow .. but I still can't figure it out. If you run the initial app you can see that it has a color picker dialog button (when you press it that window appears). How can I make something like that?
I tried using this(as he says on that website) :
ColorPickerDialog colorPickerDialog = new ColorPickerDialog(this, initialColor, new OnColorSelectedListener() {
@override
public void onColorSelected(int color) {
// do action
}
});
colorPickerDialog.show();
but I get a lot of errors. I only copied those 2 java files, nothing else. Not even the layout or something like that. What else should I copy in order to make it work ? I'm using Android Studio
I've been trying to solve this for a long time .. but however I try I won't get it done. Thank you
Click to expand...
Click to collapse
You should probably copy all the files there... if any aren't needed Android Studio will tell you as they won't be used.
Edit: Also you're doing it wrong, have a look at the demo code here & here.
Thank you for that. I will try it now. How should I add the color picker to my layout ?
Edit: I added it to my layout . Using the first demo I get the same values by clicking the button. I tried the second one, but it's a lot more complicated, and I'm getting nowhere. Thank you .
Edit2 : Thank you.I did it. I couldn't have done it without your help.