I'm a newbie on android. can you help me with this?
I want to hide or show a button in a layout, but not when it is clicked.
I mean, when the layout appears, the button is showed or hidden, depending on an if
condition in java.
the xml is:
<Button
android:layout_width="@dimen/icon_width1"
android:layout_height="@dimen/icon_width1"
android:id = "@+id/button1"
android:background="@drawable/facebook"
android:paddingRight="@dimen/space_1"
android:onClick="browser1"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
/>
and in my DetailActivity.java I have a function
public void browser1(View view) {
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.twitter.com"));
startActivity(browserIntent);
}
can someone help with this? Regards!