android-asynctask

Custom Adapter repeating

為{幸葍}努か 提交于 2019-12-25 04:24:38
问题 I have this CustomAdapter, to fill a list with my data. The problem is that the Imageview is downloaded and drawed a lot of times. Example: I search to my server a list of videos: (Video1) Title 1 Description 1 (Video2) Title 2 Description 2 (Video3) Title 3 Description 3 .. When this loads, the image from the Video1 loads, then on the same Imageview, the Video2Image load, and again for each video on the list, same times how videos are on the list. When I scroll the adapter, this download all

android - accessing Google Spreadsheet will show nullpointerexception after the internet connection is removed

佐手、 提交于 2019-12-25 03:47:09
问题 SpreadsheetService service = null; service = new SpreadsheetService("MySpreadsheetIntegration"); service.setProtocolVersion(SpreadsheetService.Versions.V3); try { String urlString = "https://spreadsheets.google.com/feeds/list/1Mq_l4I6k1TMiIq6m0EFOJSqTP3aZaGgbS1CK26cZEpE/default/public/values"; URL url = null; url = new URL(urlString); URLConnection connection = null; connection = url.openConnection(); connection.setReadTimeout(30000); connection.setConnectTimeout(30000); ListFeed feed = null;

Android asynchronous post blocks UI thread

落花浮王杯 提交于 2019-12-25 03:36:09
问题 I'm developing an Android app. I want to post to a server using asynctask. However, I still have an error which indicates that the UI thread is blocked. I want to parse the XML response and display it in a list view, but I cannot proceed because the UI thread is still blocked. public class AsynchronousPost extends ListActivity implements OnClickListener { EditText SearchValue; Button SearchBtn; String URL = ""; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Error in android application extending BaseAdapter and using Asyncktask

£可爱£侵袭症+ 提交于 2019-12-25 03:11:39
问题 i have android application that need connection between android and mysql database using php the application work perfect. only the display user action do not work this method display the user in a list with some data. can anyone help me to fix this error ?? the result of the added code is 04-14 23:17:57.766: D/this from internet(2367): usersList.get(position).getDate() is null LogCat Error 04-14 21:59:22.170: E/AndroidRuntime(1951): FATAL EXCEPTION: main 04-14 21:59:22.170: E/AndroidRuntime

Unable to add String in Arraylist in onProgressUpdate in AsyncTask

北慕城南 提交于 2019-12-25 02:59:41
问题 I am getting null arraylist "rev_arr" despite adding item in onProgressupdate. I passed String in publishprogress method. But it is not working. For easiness I had not written import statements here. Here is my code - public class det_movFragment extends Fragment { public String revmovieJsonStr; public ArrayList<String > rev_arr = new ArrayList<String>(); public det_movFragment() { } @Override public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle

Update ListView Textview vom Asyntask

早过忘川 提交于 2019-12-25 02:47:29
问题 i need to update a textView from my asynctask. I have an custom adapter for the listview and there i want to have a countdown for each entry. I will start the asynctask for each entry from my Adapter. How can i update the textview each second from the asynctask? Thanks for help :) 回答1: If you post your code, I can give you a better answer. However, a common way to update views periodically is by using Handlers. private final Handler mHandler = new Handler(); //intialize in main thread public

Update ListView Textview vom Asyntask

☆樱花仙子☆ 提交于 2019-12-25 02:47:06
问题 i need to update a textView from my asynctask. I have an custom adapter for the listview and there i want to have a countdown for each entry. I will start the asynctask for each entry from my Adapter. How can i update the textview each second from the asynctask? Thanks for help :) 回答1: If you post your code, I can give you a better answer. However, a common way to update views periodically is by using Handlers. private final Handler mHandler = new Handler(); //intialize in main thread public

Executing same asynctask multiple times with different params

ぐ巨炮叔叔 提交于 2019-12-25 02:43:46
问题 I know there are a lot of question regarding how to run the same asynctask in parallel: what i need is to execute the same asynctask but with different params per task. I have: MyTask taskOne = new MyTask(); MyTask taskOne = new MyTask(); taskOne.execute(UrlOne); taskTwo.execute(UrlTwo); MyTask have to download the page from the urlone and url two. When one of the two finishes, i kill the other one with cancel(true). But how can i run those thread in parallel? If i try this, when taskOne ends

AsyncTask, CustomBaseAdapter and Listview

爱⌒轻易说出口 提交于 2019-12-25 02:43:45
问题 I have a CustomBaseAdapter with which i fill certain fields: public ArrayList<SearchResults> GetSearchResults(){ ArrayList<SearchResults> results = new ArrayList<SearchResults>(); Document doc = Jsoup.parse(kpn); Elements tdsFromSecondColumn = doc.select("table.personaltable td:eq(0)"); Elements tdsFromSecondColumn1 = doc.select("table.personaltable td:eq(1)"); SearchResults sr1 = new SearchResults(); for (Element tdFromSecondColumn : tdsFromSecondColumn) { sr1 = new SearchResults(); sr1

setting Image as background in Widget

烂漫一生 提交于 2019-12-25 02:39:13
问题 I am Working on Widget i want to set Image (from server) as widget background.but Image is not shown. I am using Asynktask in witch i am fetching bitmap from the server. there is no Exception in code but I don't know whats the main problem. Kindly suggest me any solution about that. @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.e("Nomi1", imageView + ""); // path = Uri.parse("android.resource://"+context.getPackageName()+"/" + //