i want to make constructor take url for use this class in many activity but it not works help me please : `$`i want to make constructor take url for use the class in many activity but it not works help me please   

    there is my code
    class BackgroundTask extends AsyncTask<Void, Void, String> {
    
    
            String url1;
    there i want to take url from oncreate in main but not work
            public BackgroundTask(String json_url) {
                super();
                this.url1=json_url;
            }
    
    
            @Override
            protected String doInBackground(Void... voids) {
                try {
                    URL url =new URL(url1);
                    HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
                    InputStream inputStream = httpURLConnection.getInputStream();
                    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
                    StringBuilder stringBuilder = new StringBuilder();
                    while ((JSON_STRING_Doctor = bufferedReader.readLine()) != null) {
                        stringBuilder.append(JSON_STRING_Doctor + "\n");
                    }
                    bufferedReader.close();
                    inputStream.close();
                    httpURLConnection.disconnect();
                    return stringBuilder.toString().trim();
                } catch (MalformedURLException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return null;
            }
    
            @Override
            protected void onProgressUpdate(Void... values) {
                super.onProgressUpdate(values);
            }
    
            @Override
            protected void onPostExecute(String res) {
                json_string = res;
            }
    
     
        }

and
in oncreate i call first a new backgroudTask with url and after i call excute methode but no result json_string is null i need some help here

`$`please can any one help me
