in my application need to open link by click for retrofit i set adapter and in my adapter my code :
holder.dlbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(queryVersiones.getDl_link());
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
now i give error for startActivity ! i need help for fix this. tanks
for fix this just need to add Context in your main class
Context mContext;
after this add context befor startActivity :
holder.dlbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(queryVersiones.getDl_link());
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
mContext.startActivity(intent);
}
});