score:1
Accepted answer
add the code inside oncreate method like this in your preferencesactivity class:-
button button;
@override
protected void oncreate(bundle savedinstancestate) {
super.oncreate(savedinstancestate);
getsupportactionbar().setdisplayhomeasupenabled(true);
setcontentview(r.layout.activity_preferences);
donate = (imageview) findviewbyid(r.id.button_donate);
donate.setonclicklistener(new onclicklistener() {
@override
public void onclick(view v) {
donate(v);
}
});
button = (button) findviewbyid(r.id.button_visualhelp);
button.setonclicklistener(new onclicklistener() {
public void onclick(view arg0) {
intent myintent = new intent(preferencesativity.this,
visualhelpactivity.class);
startactivity(myintent);
}
});
spinner s = (spinner) findviewbyid(r.id.combo_language);
lang[] languages = languageutil.lang.values();
s.setadapter(new arrayadapter<lang>(this,
android.r.layout.simple_dropdown_item_1line, languages));
s.setselection(getposition(languages, languageutil.getlanguage()), true);
}
Source: stackoverflow.com
Related Query
- Eclipse, new activity on button click
- Android: How does one go about having the user click a button to create (not go to) a new activity
- how to change to a new activity from a button click inside a fragmenttab
- Open a new activity on button click
- Android - Creating a new activity in Eclipse
- create a new class do not appear right click menu eclipse
- Eclipse wizard to create new Android Activity doesn't work
- Eclipse not creating new Activity and xml layout file (issues started after updating eclipse and sdk)
- Eclipse Android Activity Wizard Not Creating New Activities
- How to add a new button to Eclipse IDE
- "create new visual classes" button not clickable on eclipse
- Disabled "Finish" Button in Android ADT r21.1 New Activity Wizard
- Eclipse wont create new Android Activity source or layout. Tried updates and sdk
- Button starts a new activity if it is pressed for 5 seconds
- Eclipse error during adding new activity
- Eclipse RCP - Opening perspective on button click
- Android - Close activity on button click
- Source not found error on button click to change activity
- How to add Python Egg to Eclipse Pydev paths? New Egg button not behaving as expected
- Eclipse does not generate New Activity after I download the latest SDK
- Eclipse PyDev doesn't shut down interpreter when you click the little red button
- Floating Action Button in android eclipse which on clicking will navigate to another activity
- Eclipse Indigo "Install new Software" has "Next" button disabled in Ubuntu 10.04.4
- Android: Add TextView from one activty, to ListView in another activity through a button click
- New launching button (Run As) in eclipse
- I am trying to use Eclipse to create a button from one activity to another but it doesn't work
- how to implement this code by adding button click that send row data to another activity
- Eclipse New Android Application 5 minutes ago had Empty Activity option
- Create new android project with out Fragment activity in eclipse
- Eclipse right click new project preferences
More Query from same tag
- Eclipse won't start with Xmx set to 1024m anymore, though there is enough memory
- Find the longest continuum in the array that the sum of the values in the continuum equal to zero modulo 3
- ServerSocket not accepting on droid emulator
- Eclipse hangs when importing Android NDK project
- Strategy to create a screen resolution independent java desktop application?
- NPE, Each time I try to delete the first visible item in ListView
- C++ Eclipse use libraries
- HTML Syntax Highlighting within Freemarker .FTL Spring STS
- eclipse-python IDE if else matching line/indicator
- Deploying and running Maven project outside Eclipse
- eclipse - building projects dependent on jars - created during ant
- Run Tomcat with Maven and Eclipse - Unknown lifecycle phase
- Java warning: "The serializable class Info does not declare a static final serialVersionUID field of type long" and 2 errors
- referring Android project to another android project
- Why does trace_printf("%f",x); trigger a hard fault on an STM32 MCU?
- Is there a way to change the text of an Action Bar Menu Item when I touch the menu item in Android?
- LD_LIBRARY_PATH cleared when logging in through xrdp
- Parametrize location where eclipse settings are saved
- Problem occured when deploying app engine project
- Tomcat/Eclipse: disable HttpSession serialization during context reload
- Get application element
- Google Play Services revision 30 missing version.xml
- error with the update of the eclipse
- Eclipse Icons license information
- How to solve warning when using liferay-ui:search-container in JSP?
- Error: Failed to execute goal on projectorg.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
- Unresolved import, urllib2 error in Eclipse
- Maven pom.xml Problems (Project Build Error "version" is missing)
- SWT RowLayout right-to-left?
- Fix Eclipse java references database corruption?