TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ghasem deh
NA
258
40.3k
how to change buttons background from another activity ?
Nov 16 2017 10:41 AM
hi, i have 3 XML layout file (in res) with several buttons . i use xml layouts in view pager into main activity in my app ... now i want change buttons background when my condition is true , how do it ?
this my button in XML layout :
<
ir.rahgoshafan.alphabetpuzzle.customs.PuzzleButton
android:id
=
"@+id/btn_green455"
android:layout_width
=
"0dp"
android:layout_height
=
"wrap_content"
android:layout_weight
=
"0.33"
android:onClick
=
"BTN_CLICK"
android:background
=
"@drawable/button_red"
android:contentDescription
=
"@string/app_name"
android:text
=
"?????? ?????"
android:textColor
=
"#fff"
android:textSize
=
"20sp"
android:textStyle
=
"bold"
/>
and view pager in main activity :
private
void
init() {
ViewPager VIEW_PAGER = (ViewPager) findViewById(R.id.tour_view_pager);
DOTS_LAYOUT = (LinearLayout) findViewById(R.id.tour_layout_dots);
LAYOUTS =
new
int
[]{R.layout.items_one, R.layout.items_two, R.layout.items_three};
addBottomDots(
0
);
TourViewPagerAdapter ViewPagerAdapter =
new
TourViewPagerAdapter();
VIEW_PAGER.setAdapter(ViewPagerAdapter);
VIEW_PAGER.addOnPageChangeListener(viewPagerPageChangeListener);
}
Reply
Answers (
1
)
xamarin Passing data
Problem with Android studio