Re: [android-developers] Problem while updating adapter from AsyncTask

2012-11-04 Thread Piren
Are you creating that AsyncTask in a background thread as well?

On Sunday, November 4, 2012 6:55:33 AM UTC+2, Bajrang Asthana wrote:

 Yes I am updating adapter in onPostExecute() method (as it runs in UI 
 thread). In onPostExecute() method i am simply calling 
 adpater.notifyDataSetChanged(). 

 On Saturday, November 3, 2012 7:58:29 PM UTC+5:30, Mark Murphy (a Commons 
 Guy) wrote:

 Make sure that you are updating your adapter in onPostExecute(), and 
 make sure that either the adapter calls notifyDataSetChanged() or you 
 call notifyDataSetChanged() on the adapter. 

 On Sat, Nov 3, 2012 at 10:15 AM, Bajrang Asthana 
 asthana...@gmail.com wrote: 
  I am getting below error while updating adapter from AsyncTask - 
  
   java.lang.IllegalStateException: The content of the adapter has 
 changed but 
  ListView did not receive a notification. Make sure the content of your 
  adapter is not modified from a background thread, but only from the UI 
  thread. [in ListView(2131230767, class android.widget.ListView) with 
  Adapter(class 
  com.ascentive.extremespeed.moreoptions.InstalledAppsListAdapter) 
  
  The purpose of doing this is to get icons of all installed apps so that 
 I 
  can display all installed apps in list view. I refer following site - 
  
  http://impressive-artworx.de/2011/list-all-installed-apps-in-style/ 
  
  please do suggest what alternate we can choose. 
  
  Thanks in Advance 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to android-d...@googlegroups.com 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com 
  For more options, visit this group at 
  http://groups.google.com/group/android-developers?hl=en 



 -- 
 Mark Murphy (a Commons Guy) 
 http://commonsware.com | http://github.com/commonsguy 
 http://commonsware.com/blog | http://twitter.com/commonsguy 

 _The Busy Coder's Guide to Android Development_ Version 4.2 Available! 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: R Can Not be Resolved

2012-11-04 Thread Pent
As previous posters have said, check your resource files in the
eclipse package exporer for red xs.

It's usually layouts with me.

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] R Can Not be Resolved

2012-11-04 Thread Piren
Actually it sounds more as if the SDK installation folder was changed... 
make sure that path ( 
/home/kevin/Downloads/android-sdk-linux/platform-tools/adb) is still the 
correct one and if not, update your PATH/ANDROID_HOME variables 
appropriately. 

On Sunday, November 4, 2012 4:48:39 AM UTC+2, Bear35805 wrote:

 I did not see any errors in the console.  I did install more of the 
 support for older Android versions and I received this error. 

 Stopping ADB server failed (code -1). 
 Unable to run 'adb': Cannot run program 
 /home/kevin/Downloads/android-sdk-linux/platform-tools/adb: 
 java.io.IOException: error=2, No such file or directory. 
 Starting ADB server failed (code -1). 


 I know this problem can also be caused by a problem in the Manifest XML 
 so I am copying it here: 

 manifest xmlns:android=http://schemas.android.com/apk/res/android; 
  package=com.dbindustries.alcohol.tracker 
  android:versionCode=1 
  android:versionName=1.0  

  uses-sdk 
  android:minSdkVersion=8 
  android:targetSdkVersion=15 / 

  application 
  android:icon=@drawable/ic_launcher 
  android:label=@string/app_name 
  android:theme=@style/AppTheme  
  activity 
  android:name=.MainActivity 
  android:label=@string/title_activity_main  
  intent-filter 
  action android:name=android.intent.action.MAIN / 

  category 
 android:name=android.intent.category.LAUNCHER / 
  /intent-filter 
  /activity 
  /application 

 /manifest 


 On 11/3/2012 5:02 PM, Mark Murphy wrote: 
  This means that either one of your resources has a problem or your 
  AndroidManifest.xml file has a problem. Look for red X marks over such 
  files in the Package Explorer, or look in the Android portion of the 
  Eclipse Console for error messages. 
  
  On Sat, Nov 3, 2012 at 5:58 PM, Kevin Brooks 
  bear...@gmail.comjavascript: 
 wrote: 
  It has been a while since I have done any Android Development.  I 
 started a 
  new project today, and after creating the project I get an error R can 
 not 
  be resolved. 
  
  I am using Eclipse Indigo 3.7 with the Latest Android SDK. 
  
  I apologize if this has already been answered, I did a search through 
 the 
  messages and couldn't find it. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to 
  android-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/android-developers?hl=en 
  
  



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Android/Windows Dual boot

2012-11-04 Thread Mad-Doggie
I know that much, but i had assumed that the devs would know a little bit 
more than i do about the boot process of android. my question was what 
file does android use to boot. In any case, i have figured it out. For 
anybody that may run across this one during a Google search, here it is:

* Back-up your data, because i accept no liability for the info below
* Create your second partition after installing Windows8
* install Ubuntu (I used 12.04) and point it to your created partition 
(format as ext3 and skip the swap file creation)
* Install GRUB with Ubuntu
* When installation is finished you can verify that Ubuntu and windows are 
dual booting
* then boot off of your android CD
* install android and install GRUB, but keep the ext3 partition intact 
(Don't format, just install over)
* You should now be able to dual boot android 4.0 and Windows8 RC

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] R Can Not be Resolved

2012-11-04 Thread Sobia Awan
R.java is a file that the Android Eclipse plugins creates while building
your application.R.java is created under the gen directory. This file is
generated from the information in the res directory. If you run select
Project - Clean... on the Eclipse menu, it will remove and then
regenerate the R.java file.

The problem R cannot be resolved happens when you change your package
name in the Androidmanifest.xml file. It uses your Android package name to
create a subdirectory under the gen directory where it stores the R.java
file.

Eclipse may have problems executing clean, because it is confused about
where the R.java file is when you have changed the Android package name.
You can either rename the subdirectory under gen to match your new package
name, or you can change your package name back to the old name. Do the
clean and then change the package name to the new name you want. This works
best if you stop Eclipse from trying to build while you are changing the
package name. Under the Project menu uncheck the option to Build
Automatically and also when the Clean... dialog asks if it should Start
a build immediately uncheck the box so it doesn't try to build while you
are changing the package name. After you have changed the name you can turn
Build Automatically back on again.

On Sun, Nov 4, 2012 at 2:58 AM, Kevin Brooks bear35...@gmail.com wrote:

 It has been a while since I have done any Android Development.  I started
 a new project today, and after creating the project I get an error R can
 not be resolved.

 I am using Eclipse Indigo 3.7 with the Latest Android SDK.

 I apologize if this has already been answered, I did a search through the
 messages and couldn't find it.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-developers@**googlegroups.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en




-- 
*Sobia Awan*
*  Bs(cs)*
**

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Applying Textapperance to whole application

2012-11-04 Thread onigunn
Hi there,

I defined an own TextApperance style in my app which inherits from the 
default style

style name=TextAppearance parent=@android:style/TextAppearance 

 item name=android:textSize18dp/item

 item name=android:textColor@android:color/black/item

 item name=android:typefacesans/item

 /style

Now I have to apply this to each TextView which I declare in my app. Is 
there a way to apply my custom TextAppearance as default for the whole 
application?

Best,

oni 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] want vertical coverflow

2012-11-04 Thread rauf qureshi
Hi friends,
I got link for coverflow but it is horizontally scrolling,but my
requirement is vertically scrolling which is given in link 2 so can any
body help me how to develop or any link for vertially scrolling Coverflow.


1)http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html

2)http://www.flexdownloads.com/preview_source/114/


Thank you
Regards,
Rauf Qureshi

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] want vertical coverflow

2012-11-04 Thread TreKing
On Sun, Nov 4, 2012 at 5:54 AM, rauf qureshi qureshira...@gmail.com wrote:

 I got link for coverflow but it is horizontally scrolling,but my
 requirement is vertically scrolling which is given in link 2 so can any
 body help me how to develop or any link for vertially scrolling Coverflow.


Take the exact logic / concept as the horizontal, but change the direction
...

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Creating OpenGL shaders from an alternate class

2012-11-04 Thread Braindrool
Still no success with glGetShaderInfoLog. Even with the work-around you 
sent.

11-04 12:16:54.626: I/System.out(1631): Finished loading: models/monkey.ply

 11-04 12:16:54.626: I/System.out(1631): Finished loading: 
 shaders/vertex/default

 11-04 12:16:54.636: W/dalvikvm(1631): threadid=12: thread exiting with 
 uncaught exception (group=0x409c01f8)

 11-04 12:16:54.636: E/AndroidRuntime(1631): FATAL EXCEPTION: GLThread 119

 11-04 12:16:54.636: E/AndroidRuntime(1631): java.lang.RuntimeException: 
 creating the shader didn't work

 11-04 12:16:54.636: E/AndroidRuntime(1631): at 
 com.braindrool.game.Shader.init(Shader.java:33)

 11-04 12:16:54.636: E/AndroidRuntime(1631): at 
 com.braindrool.game.Loading_Screen$1.run(Loading_Screen.java:212)

 11-04 12:16:54.636: E/AndroidRuntime(1631): at 
 android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1424)

 11-04 12:16:54.636: E/AndroidRuntime(1631): at 
 android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)

 11-04 12:16:54.676: I/System.out(1631): Finished loading



package com.braindrool.game;


 import java.nio.ByteBuffer;

 import java.nio.ByteOrder;

 import java.nio.IntBuffer;


 import android.opengl.GLES20;


 public class Shader {


 public Shader(String vertexShader, String fragmentShader) {

 int vertexShaderHandle = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);

 //

 *ByteBuffer tmp = ByteBuffer.allocateDirect(4);*

 * tmp.order(ByteOrder.nativeOrder());*

 * IntBuffer intbuf = tmp.asIntBuffer();*

 * //*

 * GLES20.glShaderSource(vertexShaderHandle, vertexShader);*

 * GLES20.glCompileShader(vertexShaderHandle);*

 * final int[] vertexCompileStatus = new int[1];*

 * GLES20.glGetShaderiv(vertexShaderHandle, GLES20.GL_COMPILE_STATUS,*

 * intbuf);*

 *
 *

 * if (intbuf.get(0) == 0) {*

 * GLES20.glGetShaderiv(vertexShaderHandle, GLES20.GL_INFO_LOG_LENGTH,*

 * intbuf);*

 * int infoLogLength = intbuf.get(0);*

 * if (infoLogLength  1) {*

 * String infoLog = GLES20.glGetShaderInfoLog(vertexShaderHandle);*

 * System.err.println(shader log:\n + infoLog);*

 * }*

 * throw new RuntimeException(creating the shader didn't work);*

 * }*


 //

 if (vertexCompileStatus[0] == 0) {

 GLES20.glDeleteShader(vertexShaderHandle);

 System.err.println(Deleting vertex shader);

 vertexShaderHandle = 0;

 }


 if (vertexShaderHandle == 0) {


 System.err.println(Error creating vertex shader);

 }

 // 

 int fragmentShaderHandle = GLES20

 .glCreateShader(GLES20.GL_FRAGMENT_SHADER);


 if (fragmentShaderHandle != 0) {

 System.out.println(Fragmentshaderhandle success);

 GLES20.glShaderSource(fragmentShaderHandle, fragmentShader);

 GLES20.glCompileShader(fragmentShaderHandle);

 final int[] fragmentCompileStatus = new int[1];

 GLES20.glGetShaderiv(fragmentShaderHandle,

 GLES20.GL_COMPILE_STATUS, fragmentCompileStatus, 0);

 if (fragmentCompileStatus[0] == 0) {

 GLES20.glDeleteShader(fragmentShaderHandle);

 fragmentShaderHandle = 0;

 }

 }


 if (fragmentShaderHandle == 0) {

 System.err.println(Error creating fragment shader.);

 }


 System.out

 .println(linkShaders(vertexShaderHandle, fragmentShaderHandle));

 }


 private int linkShaders(int vertexHandle, int fragmentHandle) {

 int programHandle = GLES20.glCreateProgram();


 if (programHandle != 0) {

 GLES20.glAttachShader(programHandle, vertexHandle);

 GLES20.glAttachShader(programHandle, fragmentHandle);

 GLES20.glBindAttribLocation(programHandle, 0, a_Position);

 GLES20.glBindAttribLocation(programHandle, 1, a_Color);

 GLES20.glLinkProgram(programHandle);

 final int[] linkStatus = new int[1];

 GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS,

 linkStatus, 0);

 if (linkStatus[0] == 0) {

 GLES20.glDeleteProgram(programHandle);

 programHandle = 0;

 }

 }


 if (programHandle == 0) {

 System.err.println(Error creating program.);

 }

 return programHandle;

 }

 }



On Friday, November 2, 2012 6:57:55 PM UTC-5, RichardC wrote:

 You need to call: glGetShaderInfoLog to get the output from the shader 
 compiler if there is an error.

 HOWEVER it is bugged:
 http://code.google.com/p/android/issues/detail?id=9953

 The work-round is in comment 7


 On Friday, November 2, 2012 11:20:09 PM UTC, Kostya Vasilyev wrote:

  It's pretty weird to see the \n-s make it into the log as is...

 Do your shader files perhaps contain those two symbols (the backslash and 
 the n) at the end of each line? Are they really supposed to be there if 
 they do?
  


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Applying Textapperance to whole application

2012-11-04 Thread Lance Nanek
I don't know about modifying the default theme, but it's easy to make your 
own and use it in your AndroidManifest.xml so you don't have to set it on 
each TextView.

You can refer to your text appearance from a TextView style in your 
styles.xml:

style name=BodyTextView parent=android:style/Widget.TextView
item name=android:textAppearance@style/TextAppearance/item 
/style 

Then you can refer to the TextView style from a theme in your styles.xml:

style name=Theme.MyTheme parent=@android:style/Theme.NoTitleBar
item name=android:textViewStyle@style/BodyTextView/item 
/style

Then you can use this theme on the application or activity elements in your 
AndroidManifest.xml (or set it programatically):

activity
android:theme=@style/Theme.MyTheme
...

That will apply your text appearance to the TextView's used without having 
to put style attributes on them directly..

On Sunday, November 4, 2012 3:40:29 AM UTC-8, onigunn wrote:

 Hi there,

 I defined an own TextApperance style in my app which inherits from the 
 default style

 style name=TextAppearance parent=@android:style/TextAppearance 

 item name=android:textSize18dp/item

 item name=android:textColor@android:color/black/item

 item name=android:typefacesans/item

 /style

 Now I have to apply this to each TextView which I declare in my app. Is 
 there a way to apply my custom TextAppearance as default for the whole 
 application?

 Best,

 oni 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Applying Textapperance to whole application

2012-11-04 Thread onigunn
 

Awesome! Thanks for this Lance!

I've tried to add my textAppearance to my Theme but this doesn't worked. 
Your solution works like a charm.

Am Sonntag, 4. November 2012 12:40:29 UTC+1 schrieb onigunn:

 Hi there,

 I defined an own TextApperance style in my app which inherits from the 
 default style

 style name=TextAppearance parent=@android:style/TextAppearance 

 item name=android:textSize18dp/item

 item name=android:textColor@android:color/black/item

 item name=android:typefacesans/item

 /style

 Now I have to apply this to each TextView which I declare in my app. Is 
 there a way to apply my custom TextAppearance as default for the whole 
 application?

 Best,

 oni 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Adding shadow drops to Views

2012-11-04 Thread onigunn
Hi there,

after googling around I'm not quite sure which way is the most 
common/preferred. I would like to add some shadows to ImageViews and to a 
RelativeLayout (this one is special: Shadows only on top and bottom).

What I've found where solutions by overriding classes and the View#onDraw 
method. Another approach seems to create a drawable shape and place them 
directly as background source or place them before and after the desired 
view. Last advice was to apply a 9patch bitmap as background.

Isn't there a more easy way to achieve this? 

Best,

oni

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Live voice changing during call (VOICE_UPLINK, VOICE_DOWNLINK)

2012-11-04 Thread Danny S.
Hi friends,

I want to discuss an issue I thought about many times. I want to change the 
voice during a call, so for incoming and/or outgoing audio. I read about 
VOICE_UPLINK (for outgoing audio) and VOICE_DOWNLINK (for incoming audio).

I won't record the call and save it into a local audio file. I want to get 
the audio stream and change it in nearly realtime before it will be passed 
to my ear (downlink) or the person on the other side (uplink). After long 
google'ing I found only keywords like e.g. VOICE_UPLINK/-_DOWNLINK.

I don't know whether it is possible... I read that it's already difficult 
to record Android calls.

Thank you very much!
-Danny S.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Live voice changing during call (VOICE_UPLINK, VOICE_DOWNLINK)

2012-11-04 Thread Mark Murphy
AFAIK, this is not possible, sorry.

On Sun, Nov 4, 2012 at 5:05 PM, Danny S. danny.schi...@googlemail.com wrote:
 Hi friends,

 I want to discuss an issue I thought about many times. I want to change the
 voice during a call, so for incoming and/or outgoing audio. I read about
 VOICE_UPLINK (for outgoing audio) and VOICE_DOWNLINK (for incoming audio).

 I won't record the call and save it into a local audio file. I want to get
 the audio stream and change it in nearly realtime before it will be passed
 to my ear (downlink) or the person on the other side (uplink). After long
 google'ing I found only keywords like e.g. VOICE_UPLINK/-_DOWNLINK.

 I don't know whether it is possible... I read that it's already difficult to
 record Android calls.

 Thank you very much!
 -Danny S.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.2 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Maven vs Ant

2012-11-04 Thread uud ashr
So it has the same consideration with regular java project then.
Thx for the help.

Regards,
Uud

On Sat, Nov 3, 2012 at 1:30 PM, dnk dnkou...@gmail.com wrote:

 For small apps with a few library modules, ant should suffice.

 For bigger projects, different repos that share code etc Maven is the way
 to go.


 On Friday, November 2, 2012 12:00:31 AM UTC-7, uudashr wrote:

 Hi all,

 I see in maven repo, some of android version not exists (ex: android
 4.0.3) and official SDK already support the ant script.
 Which one preferred or better for android dev?

 Regards,
 Uud

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem while updating adapter from AsyncTask

2012-11-04 Thread Bajrang Asthana
Hi Piren,

I am creating AsyncTask in onCreate() method of Activity.  I am modifying 
adapter in doInBackground() method of AsyncTask. And finally calling 
adpater.notifyDataSetChanged() method.

On Sunday, November 4, 2012 1:45:17 PM UTC+5:30, Piren wrote:

 Are you creating that AsyncTask in a background thread as well?

 On Sunday, November 4, 2012 6:55:33 AM UTC+2, Bajrang Asthana wrote:

 Yes I am updating adapter in onPostExecute() method (as it runs in UI 
 thread). In onPostExecute() method i am simply calling 
 adpater.notifyDataSetChanged(). 

 On Saturday, November 3, 2012 7:58:29 PM UTC+5:30, Mark Murphy (a Commons 
 Guy) wrote:

 Make sure that you are updating your adapter in onPostExecute(), and 
 make sure that either the adapter calls notifyDataSetChanged() or you 
 call notifyDataSetChanged() on the adapter. 

 On Sat, Nov 3, 2012 at 10:15 AM, Bajrang Asthana 
 asthana...@gmail.com wrote: 
  I am getting below error while updating adapter from AsyncTask - 
  
   java.lang.IllegalStateException: The content of the adapter has 
 changed but 
  ListView did not receive a notification. Make sure the content of your 
  adapter is not modified from a background thread, but only from the UI 
  thread. [in ListView(2131230767, class android.widget.ListView) with 
  Adapter(class 
  com.ascentive.extremespeed.moreoptions.InstalledAppsListAdapter) 
  
  The purpose of doing this is to get icons of all installed apps so 
 that I 
  can display all installed apps in list view. I refer following site - 
  
  http://impressive-artworx.de/2011/list-all-installed-apps-in-style/ 
  
  please do suggest what alternate we can choose. 
  
  Thanks in Advance 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to android-d...@googlegroups.com 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com 
  For more options, visit this group at 
  http://groups.google.com/group/android-developers?hl=en 



 -- 
 Mark Murphy (a Commons Guy) 
 http://commonsware.com | http://github.com/commonsguy 
 http://commonsware.com/blog | http://twitter.com/commonsguy 

 _The Busy Coder's Guide to Android Development_ Version 4.2 Available! 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Adding shadow drops to Views

2012-11-04 Thread Zsolt Vasvari
The 2nd method seems very simple to me.  If you are looking for a 
setDisplayShadow(boolean) method, no, there isn't one.

On Monday, November 5, 2012 6:02:56 AM UTC+8, onigunn wrote:

 Hi there,

 after googling around I'm not quite sure which way is the most 
 common/preferred. I would like to add some shadows to ImageViews and to a 
 RelativeLayout (this one is special: Shadows only on top and bottom).

 What I've found where solutions by overriding classes and the View#onDraw 
 method. Another approach seems to create a drawable shape and place them 
 directly as background source or place them before and after the desired 
 view. Last advice was to apply a 9patch bitmap as background.

 Isn't there a more easy way to achieve this? 

 Best,

 oni


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Problem while updating adapter from AsyncTask

2012-11-04 Thread Danny D



 I'm pretty sure that you're going to need to do these updates through the 
runOnUiThread() method.
Here's an example of how I typically notify the list adapter/view /etc.

Basically, if I think that there's any chance of cross thread problems, opt 
for the runOnUiThread()

 @Override

public void imageAvailable(String imageName) {
this.runOnUiThread(new Runnable(){
@Override
public void run() {
m_backpackAdapter.notifyDataSetChanged();
}
});
}



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Forum very slow

2012-11-04 Thread Zsolt Vasvari
Wow, has this forum really slowed down...   Where have all the posters have 
migrated to, I wonder?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en