Skip to content
Advertisement

unable to transfer some data to a new page

I want to show the data I got from json in my android project in the search layout section, but the data is not visible. Can you help me?

My Code:

JavaScript

Search Fragment.java

JavaScript

XML Country İtem

JavaScript

Hello, I want to show the data I got from json in my android project in the search layout section, but the data is not visible. Can you help me?

Advertisement

Answer

You are retrieving your data in your main activity and sending the data through your intent

intent.putExtra("city", country.getText().toString()); intent.putExtra("temp",temp.getText().toString());

However, you are not fetching the data that you sent through intent in your fragment. You have to fetch them according to the key values by which you sent. In your onCreateView() in your fragment, you can fetch each data you sent through your intent in the form:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement