android - Custom progress bar, doesn't show progress -


in application i'm inserting custom progress bar. problem is not shown progress. when in code call setprogress, bar remains background color. whereas if in layout setting setprogress shown normally. before inserting custom toolbar, worked perfectly

here code:

drawable/customprogressbar.xml

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">      <!-- define background properties color etc -->     <item android:id="@android:id/background">     <shape>         <corners            android:radius="5dip" />         <gradient                 android:startcolor="#5c5c5b"                 android:endcolor="#9d9d9c"                 android:centery="1"                 android:angle="270"         />     </shape>    </item>     <!-- define progress properties start color, end color etc -->   <item android:id="@android:id/progress">     <clip>         <shape>             <corners               android:radius="5dip" />             <gradient                 android:startcolor="#85040b"                 android:endcolor="#e30613"                 android:centery="1"                 android:angle="270"             />         </shape>     </clip>     </item> </layer-list>  

and layout see progress bar

 <progressbar         android:id="@+id/progressbar1"         style="@android:style/widget.progressbar.horizontal"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentleft="true"         android:layout_alignparentright="true"         android:max="100"         android:progress="50"         android:layout_aligntop="@+id/map"         android:progressdrawable="@drawable/customprogressbar"         android:visibility="visible" /> 

in code call

progresbar.setprogress(progress);  

to set progress

i found error. code correct. call "setprogress" on "if-else" in if state. correct code (on progress update of asynctask

 if(i[3]==1){                 setmarker(coordoggetto, i[0] , tipo, nome, indirizzo);}                  progresbar.setprogress(i[1]);                 tv_completamento.settext(i[1]+"%");             } 

thank's comment


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -