I have an activity that goes to my server and fetches a .txt file with a string inside. I want to call the string in the .txt file from another activity to use as a variable in a function. How can I make this public? And how do I call it from another activity? Code:
public class getter extends AppCompatActivity {
String TextFileURL = "http://1.2.3.4/test.txt" ;
TextView textView ;
Button button ;
URL url ;
String TextHolder = "" , TextHolder2 = "";
BufferedReader bufferReader ;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_get);
    textView = (TextView)findViewById(R.id.textView);
    button = (Button)findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            new GetNotePadFileFromServer().execute();
        }
    });
}
public class GetNotePadFileFromServer extends AsyncTask<Void, Void, Void>{
    @Override
    protected Void doInBackground(Void... params) {
        try {
            url = new URL(TextFileURL);
            bufferReader = new BufferedReader(new InputStreamReader(url.openStream()));
            while ((TextHolder2 = bufferReader.readLine()) != null) {
                TextHolder += TextHolder2;
            }
            bufferReader.close();
        } catch (MalformedURLException malformedURLException) {
            // TODO Auto-generated catch block
            malformedURLException.printStackTrace();
            TextHolder = malformedURLException.toString();
        } catch (IOException iOException) {
            // TODO Auto-generated catch block
            iOException.printStackTrace();
            TextHolder = iOException.toString();
        }
        return null;
    }
    @Override
    protected void onPostExecute(Void finalTextHolder) {
        textView.setText(TextHolder);
        super.onPostExecute(finalTextHolder);
    }
}
And I am attempting to call the string with this:
    public static int getinstVersionCode(Context mContext) {
    if (mContext != null) {
        try {
            return mContext.getPackageManager().getPackageInfo(getter.GetNotePadFileFromServer., 0).versionCode;
        } catch (PackageManager.NameNotFoundException ignored) {
        }
    }
    return 0;
}
