Android - Deprecated AsyncTask

 
Vista:

Deprecated AsyncTask

Publicado por Jonatan (1 intervención) el 23/11/2021 02:49:01
Hola gente buenas dias, tengo una duda con una seccion de mi codigo, me dice deprecated para build 30 o Android 11 dejo el codigo abajo como podria implementar para que funcione en 11

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
private class loadData extends AsyncTask<String, Void, String> {
 
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }
 
        @Override
        protected String doInBackground(String... params) {
            return Tools.getJSONString(params[0]);
        }
 
        @Override
        protected void onPostExecute(String result) {
            super.onPostExecute(result);
 
            if (null == result || result.length() == 0) {
                openMainActivity();
                Toast.makeText(getApplicationContext(), getResources().getString(R.string.dialog_internet_description), Toast.LENGTH_SHORT).show();
            } else {
                try {
                    JSONObject mainJson = new JSONObject(result);
                    JSONArray arrayJson = mainJson.getJSONArray("result");
                    JSONObject c;
 
                    for (int i = 0; i < arrayJson.length(); i++) {
                        c = arrayJson.getJSONObject(i);
                        radio_name = c.getString("radio_name");
                        radio_url = c.getString("radio_url");
                        Constant.itemRadio = new ItemRadio(radio_name, radio_url);
                    }
 
                    sharedPref.saveURL(radio_name, radio_url);
 
                    new Handler().postDelayed(ActivitySplash.this::openMainActivity, 1000);
                } catch (JSONException e) {
                    e.printStackTrace(e);
                    new Handler().postDelayed(ActivitySplash.this::openMainActivity, 1000);
                    Toast.makeText(getApplicationContext(), getResources().getString(R.string.dialog_internet_description), Toast.LENGTH_SHORT).show();
                }
            }
        }
    }
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Deprecated AsyncTask

Publicado por Scott (2 intervenciones) el 19/05/2022 23:19:45
Good evening guys! Our platform us.grademiners.com provide these unique essays for our clients. When you hire a writer for your essay from our service, you are assured that you would receive a 100% plagiarism-free composition.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Deprecated AsyncTask

Publicado por Vassa (4 intervenciones) el 05/06/2022 21:20:44
It can be difficult to choose a legitimate essay writing service that can deliver top-quality work. While there are dozens of such services, it is vital to do your homework before committing to one. In this peachyessay.com review, you will learn what to look for in a reliable essay writing service. Keep reading for more details. Also, read our review of other similar services to get a better idea of the company's reliability.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Deprecated AsyncTask

Publicado por Jacob (2 intervenciones) el 08/09/2022 21:50:45
Good post, very well written. If you need help writing an equally good post, article, or research paper, we will help you https://paperwritingservices.reviews/essay-box-review/ the result will surprise you!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Deprecated AsyncTask

Publicado por Osborn (1 intervención) el 03/11/2022 08:15:37
If you're looking for a reputable cv writing service reviews uk, you've come to the right place. You'll find testimonials from successful job seekers who have used CV writing services in the past. That means they're probably not just good writers; they're also highly qualified. So, what should you look for in a CV writing service?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

Deprecated AsyncTask

Publicado por shawn (2 intervenciones) el 12/11/2022 08:52:11
Thanks for sharing this best stuff with us! Keep sharing! I am new in blog writing. All types of blogs and posts are not helpful for the readers. Here the author is giving good thoughts and suggestions to each and every reader through this article. literature-essay Quality of the content is the main element of the do my assignment blog and this is the way of writing and presenting.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar