I have an android application in which i have a hyperlink which opens in a browser.Its Right that Hyperlink on visible when any one enter right password otherwise it remain invisible.Problem is that if any one view the hyperlink by entering a correct password in browser then he will never need to again open the android app to open the hyperlink,So finally i want that user have to open the android app every time when he wants to view the page behind hyperlink. Here is My code through which i am making a hyperlink.
Password=(EditText)findViewById(R.id.pass);
login=(Button)findViewById(R.id.login);
txtDash=(TextView)findViewById(R.id.txtDash);
String linkText = "Visit the <a href='http://sml.com.pk/a/cms/cmsdbandroid.php'>CMS Dashboard</a> web page.";
txtDash.setText(Html.fromHtml(linkText));
txtDash.setMovementMethod(LinkMovementMethod.getInstance());
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View V) {
try {
if (Password.getText().toString().equals("dsml"))
{
txtDash.setVisibility(View.VISIBLE);
login.setVisibility(View.INVISIBLE);
Password.setVisibility(View.INVISIBLE);
}
else
{
Toast.makeText(getBaseContext(), "invalid password - try again", Toast.LENGTH_SHORT).show();
}
}catch(Exception e){
//Log.e("log_tag", "Error"+e.toString());
Toast.makeText(getBaseContext(), e.toString(), Toast.LENGTH_SHORT).show();
}
}
});
Please Any One Help me to do this
Rather then opening the browser you can launch the URL in web view. URL would not be visible to the user in the web view. Check out this link for web view details.