Here is my code and i am getting error that cannot access fragment at line "Ion.with(getApplicationContext())". How to fix?
Button j = findViewById(R.id.btn_get); j.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Ion.with(getApplicationContext()) .load("http://api.icndb.com/joke/random/?limitTo=[nerdy]") .asJsonObject() .setCallback(new FutureCallback<JsonObject>() { @Override public void onCompleted(Exception e, JsonObject result) { JsonObject value = result.getAsJsonObject("value"); String joke = value.get("joke").toString(); TextView textView = findViewById(R.id.tv_joke); textView.setText(joke); } }); } });
https://stackoverflow.com/questions/67410629/class-file-for-android-support-v4-app-fragment-not-found May 06, 2021 at 09:08AM
没有评论:
发表评论