English 中文(简体)
在浮标点表要素之后,可调取的听众: and
原标题:disable listener after onclick listview element : android

我有一份名单。 我一开始,就向我的服务器提出请求。 我在主机上显示一个星号,然后是回复到时的又一个星号。 我不赞成名单上的点击。 这样做的最佳方式是什么? 我尝试了一种简单的 b子,但在服务器做出回复之前,它总是回到原来的状态。 此外,还试图破坏布局要素,并 would。 建议

//beginning of my FirstClass
static boolean wait = false;

//...some code

setListAdapter(new ArrayAdapter<String>(this, R.layout.main, arraylist));

        lv.setOnItemClickListener(new OnItemClickListener() {

            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                if(!wait){
                    wait = true;
                    Toast.makeText(getApplicationContext(), "Processing...",Toast.LENGTH_SHORT).show();
                    String URL = "myurl";
                    new RequestTask(getApplicationContext()).execute(URL);
               }
            }
        });

在我的要求范围内, 任务班次

@Override
protected void onPostExecute(String result) {
    super.onPostExecute(result);
    Toast.makeText(this.context, result,Toast.LENGTH_SHORT).show();
    FirstClass.wait = false; // turn it back to false?
}
问题回答

我认为,如果你有<条码>/开脱<>/条码>,然后在您的请购书中加以区别,那么你的最佳信条就是说。 请求的任务很可能在不同的线上执行。 这意味着:// end disable? 守则将在你创建“请求书”后不久执行(这很可能是为什么在请求完成之前,菜豆能够回落)。 但是,如果你通过任务提及你所谈论的 b(通过建筑商),那么你就可以让塔克公司在其吉卜赛人协会的要求完成时打破僵局。

因此,基本上,请Task提到你与大不列颠及北爱尔兰联合王船公司重新合作,如果它要求完成,就能够这样做。 或者,在您的活动中界定了以下功能:enableListView(>(或者可能的话,backgroundRequestComplete(),这些功能实际上使养蜂业得以实现。 然后请Task提到你的活动,并在完成后使用“ListView()”方法。

I m not entirely sure what you did there but what about something like:

lv.setOnItemClickListener(null);

如果我回答问题是错误的,我会感到担忧。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签