I’m a PHP Web Developer. When I create a view article page I was passing the id in GET something like article.php?id=10
But now in android if I have an activity which views the article, how to pass to it the article ID to select it’s data from the database?
What is my best option?
You have to pass the article id in the intent when calling the ArticleActivity. Here is how to do it:
In this code, this is the context of your current activity; articleId is your articleId you want to pass. Then, when you want to retrieve it in the ArticleActivity, you do this in onCreate of the activity:
Thats it! Hope that helped.