I modified my code like follows according to what i understood from a stack overflow question i found
private static final String url = "http://****/get_items.php?keyword=%1$s";
String searchKey = getIntent().getStringExtra("2");
Final_url = String.format(url, searchKey);
when i print the Final_url like this
Toast.makeText(getApplicationContext(),"url = "+ Final_url, Toast.LENGTH_SHORT).show();
the printed value is always
url = http://*****/get_items.php?keyword=null
Is There Something I'm Missing ?