Here is my confirm__button.xml
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ConfirmButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/buttonConfirm" >
</Button>
here is my styles.xml
<resources>
<style name="buttonConfirm" parent="#android:style/Widget.Button">
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">15dip</item>
<item name="android:background">#drawable/ok_button_style</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
</style>
</resources>
here is my ok_button_style.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#F6974F"
android:centerColor="#F58A39"
android:endColor="#F48028"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#F37C22" />
<corners
android:radius="6dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<gradient
android:startColor="#F6974F"
android:centerColor="#F58A39"
android:endColor="#F48028"
android:angle="270" />
<stroke
android:width="2dp"
android:color="#F48028" />
<corners
android:radius="6dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item android:state_enabled="true" >
<shape>
<gradient
android:startColor="#F48028"
android:centerColor="#F58A39"
android:endColor="#F6974F"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#F5812A" />
<corners
android:radius="6dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item android:state_enabled="false" >
<shape>
<solid
android:color="#FFB380" />
<stroke
android:width="1dp"
android:color="#FFA366" />
<corners
android:radius="6dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#F48028"
android:centerColor="#F58A39"
android:endColor="#F6974F"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#F37C22" />
<corners
android:radius="6dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
TestActivity.java
public class TestActivity extends Activity {
private Button btnConfirm;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnConfirm = (ConfirmButton)findViewById(R.id.confirmButton1);
btnConfirm.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
btnConfirm.setEnabled(false);
}
});
}
}
public class ConfirmButton extends Button{
public ConfirmButton(Context context) {
super(context);
}
public ConfirmButton(Context context, AttributeSet attrs) {
this(context, attrs, R.layout.confirm__button);
}
public ConfirmButton(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}
I do not understand why the btnConfirm has no buttonConfirm style.
Just casting to your ConfirmButton won't "change" the type of the button. You need change to change your XML to actually reference your class. I don't know your package but,
go for this:
<com.your.package.TestActivity$ConfirmButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ConfirmButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/buttonConfirm" >
</com.your.package.TestActivity$ConfirmButton>
You should also EITHER make ConfirmButton a static class, or move it up into a class of it's own.
Related
I'm a beginner with android development and I need your assistance, I have a simple app with a webview to load local HTML pages, I put all my files inside assets, now in my navigation drawer I want to have some text/links that open these pages.
here is my code:
MainActivity.java
package com.example.psalms;
import android.os.Bundle;
import android.view.View;
import android.view.Menu;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.navigation.NavigationView;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
public class MainActivity extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration;
private WebView mWebView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWebView = (WebView) findViewById(R.id.activity_main_webview);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
.setDrawerLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
// Enable Javascript
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/index.html");
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
}
activity_main_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:title="#string/home" />
<item
android:title="#string/erminia" />
<item
android:title="#string/psalmos1" />
<item
android:title="#string/psalmos2" />
<item
android:title="#string/psalmos3" />
<item
android:title="#string/psalmos4" />
<item
android:title="#string/psalmos5" />
<item
android:title="#string/psalmos6" />
<item
android:title="#string/psalmos7" />
<item
android:title="#string/psalmos8" />
<item
android:title="#string/psalmos9" />
<item
android:title="#string/psalmos10" />
<item
android:title="#string/psalmos11" />
<item
android:title="#string/psalmos12" />
<item
android:title="#string/psalmos13" />
<item
android:title="#string/psalmos14" />
<item
android:title="#string/psalmos15" />
<item
android:title="#string/psalmos16" />
<item
android:title="#string/psalmos17" />
<item
android:title="#string/psalmos18" />
<item
android:title="#string/psalmos19" />
<item
android:title="#string/psalmos20" />
<item
android:title="#string/psalmos21" />
<item
android:title="#string/psalmos22" />
<item
android:title="#string/psalmos23" />
<item
android:title="#string/psalmos24" />
<item
android:title="#string/psalmos25" />
<item
android:title="#string/psalmos26" />
<item
android:title="#string/psalmos27" />
<item
android:title="#string/psalmos28" />
<item
android:title="#string/psalmos29" />
<item
android:title="#string/psalmos30" />
<item
android:title="#string/psalmos31" />
<item
android:title="#string/psalmos32" />
<item
android:title="#string/psalmos33" />
<item
android:title="#string/psalmos34" />
<item
android:title="#string/psalmos35" />
<item
android:title="#string/psalmos36" />
<item
android:title="#string/psalmos37" />
<item
android:title="#string/psalmos38" />
<item
android:title="#string/psalmos39" />
<item
android:title="#string/psalmos40" />
<item
android:title="#string/psalmos41" />
<item
android:title="#string/psalmos42" />
<item
android:title="#string/psalmos43" />
<item
android:title="#string/psalmos44" />
<item
android:title="#string/psalmos45" />
<item
android:title="#string/psalmos46" />
<item
android:title="#string/psalmos47" />
<item
android:title="#string/psalmos48" />
<item
android:title="#string/psalmos49" />
<item
android:title="#string/psalmos50" />
<item
android:title="#string/psalmos51" />
<item
android:title="#string/psalmos52" />
<item
android:title="#string/psalmos53" />
<item
android:title="#string/psalmos54" />
<item
android:title="#string/psalmos55" />
<item
android:title="#string/psalmos56" />
<item
android:title="#string/psalmos57" />
<item
android:title="#string/psalmos58" />
<item
android:title="#string/psalmos59" />
<item
android:title="#string/psalmos60" />
<item
android:title="#string/psalmos61" />
<item
android:title="#string/psalmos62" />
<item
android:title="#string/psalmos63" />
<item
android:title="#string/psalmos64" />
<item
android:title="#string/psalmos65" />
<item
android:title="#string/psalmos66" />
<item
android:title="#string/psalmos67" />
<item
android:title="#string/psalmos68" />
<item
android:title="#string/psalmos69" />
<item
android:title="#string/psalmos70" />
<item
android:title="#string/psalmos71" />
<item
android:title="#string/psalmos72" />
<item
android:title="#string/psalmos73" />
<item
android:title="#string/psalmos74" />
<item
android:title="#string/psalmos75" />
<item
android:title="#string/psalmos76" />
<item
android:title="#string/psalmos77" />
<item
android:title="#string/psalmos78" />
<item
android:title="#string/psalmos79" />
<item
android:title="#string/psalmos80" />
<item
android:title="#string/psalmos81" />
<item
android:title="#string/psalmos82" />
<item
android:title="#string/psalmos83" />
<item
android:title="#string/psalmos84" />
<item
android:title="#string/psalmos85" />
<item
android:title="#string/psalmos86" />
<item
android:title="#string/psalmos87" />
<item
android:title="#string/psalmos88" />
<item
android:title="#string/psalmos89" />
<item
android:title="#string/psalmos90" />
<item
android:title="#string/psalmos91" />
<item
android:title="#string/psalmos92" />
<item
android:title="#string/psalmos93" />
<item
android:title="#string/psalmos94" />
<item
android:title="#string/psalmos95" />
<item
android:title="#string/psalmos96" />
<item
android:title="#string/psalmos97" />
<item
android:title="#string/psalmos98" />
<item
android:title="#string/psalmos99" />
<item
android:title="#string/psalmos100" />
<item
android:title="#string/psalmos101" />
<item
android:title="#string/psalmos102" />
<item
android:title="#string/psalmos103" />
<item
android:title="#string/psalmos104" />
<item
android:title="#string/psalmos105" />
<item
android:title="#string/psalmos106" />
<item
android:title="#string/psalmos107" />
<item
android:title="#string/psalmos108" />
<item
android:title="#string/psalmos109" />
<item
android:title="#string/psalmos110" />
<item
android:title="#string/psalmos111" />
<item
android:title="#string/psalmos112" />
<item
android:title="#string/psalmos113" />
<item
android:title="#string/psalmos114" />
<item
android:title="#string/psalmos115" />
<item
android:title="#string/psalmos116" />
<item
android:title="#string/psalmos117" />
<item
android:title="#string/psalmos118" />
<item
android:title="#string/psalmos119" />
<item
android:title="#string/psalmos120" />
<item
android:title="#string/psalmos121" />
<item
android:title="#string/psalmos122" />
<item
android:title="#string/psalmos123" />
<item
android:title="#string/psalmos124" />
<item
android:title="#string/psalmos125" />
<item
android:title="#string/psalmos126" />
<item
android:title="#string/psalmos127" />
<item
android:title="#string/psalmos128" />
<item
android:title="#string/psalmos129" />
<item
android:title="#string/psalmos130" />
<item
android:title="#string/psalmos131" />
<item
android:title="#string/psalmos132" />
<item
android:title="#string/psalmos133" />
<item
android:title="#string/psalmos134" />
<item
android:title="#string/psalmos135" />
<item
android:title="#string/psalmos136" />
<item
android:title="#string/psalmos137" />
<item
android:title="#string/psalmos138" />
<item
android:title="#string/psalmos139" />
<item
android:title="#string/psalmos140" />
<item
android:title="#string/psalmos141" />
<item
android:title="#string/psalmos142" />
<item
android:title="#string/psalmos143" />
<item
android:title="#string/psalmos144" />
<item
android:title="#string/psalmos145" />
<item
android:title="#string/psalmos146" />
<item
android:title="#string/psalmos147" />
<item
android:title="#string/psalmos148" />
<item
android:title="#string/psalmos149" />
<item
android:title="#string/psalmos150" />
<item
android:title="#string/psalmos151" />
</group>
</menu>
mobile_navigation.xml
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/mobile_navigation"
app:startDestination="#+id/nav_home">
<fragment
android:id="#+id/nav_home"
android:name="com.example.psalms.ui.home.HomeFragment"
android:label="#string/home"
tools:layout="#layout/fragment_home">
<action
android:id="#+id/action_HomeFragment_to_HomeSecondFragment"
app:destination="#id/nav_home_second" />
</fragment>
<fragment
android:id="#+id/nav_home_second"
android:name="com.example.psalms.ui.home.HomeSecondFragment"
android:label="#string/home_second"
tools:layout="#layout/fragment_home_second">
<action
android:id="#+id/action_HomeSecondFragment_to_HomeFragment"
app:destination="#id/nav_home" />
<argument
android:name="myArg"
app:argType="string" />
</fragment>
<fragment
android:id="#+id/nav_gallery"
android:name="com.example.psalms.ui.gallery.GalleryFragment"
android:label="#string/erminia"
tools:layout="#layout/fragment_gallery" />
<fragment
android:id="#+id/nav_slideshow"
android:name="com.example.psalms.ui.slideshow.SlideshowFragment"
android:label="#string/psalmos1"
tools:layout="#layout/fragment_slideshow" />
</navigation>
First you need to place IDs in your menu item xml, for you to be able to distinguish and call them (yes, all of them) here is an example:
<item
android:id="#+id/nav_home"
android:title="#string/home" />
You need to add onNavigationItemSelectedListener:
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener
Then add method:
#Override
public boolean onNavigationItemSelected(#NonNull MenuItem item) {
String url = "";
switch (item.getItemId()) {
case R.id.nav_home: {
url = "https://google.com";
break;
}
// Add all your items as case
}
// We will make this method later.
openUrl(url);
mDrawerLayout.closeDrawer(GravityCompat.START);
return true;
}
Add this below your navigationView code:
navigationView.setNavigationItemSelectedListener(this);
Create this function:
private void openUrl(final String url) {
if (url!= null) {
// This can also be an intent to your WebView Activity, passing the link in the extras
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
}
}
I'm trying to change the background color of a button I made to a certain color when toggled and back when untoggled, but when I do the color changes the shape of the button.
Here is my code:
public void onClick(View v){
if(index < 9)
GameEngine.getInstance().setNumber(number);
else if(index == 9)
GameEngine.getInstance().setNumber(number);
else if (index == 12) {
GameEngine.getInstance().draftModeSetter();
v.setBackgroundColor(Color.parseColor("#ffb6c1"));
}
}
And here is the result before color change and the result after color change. You can clearly see the "draft" button gets becomes bigger and a sharper square.
If the background color was set using
btn.getBackground().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
it can be reset using:
btn.getBackground().clearColorFilter();
I think you should use xml : shape, selector like :
shape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="5dp" />
<solid android:color="#color/blue_400" />
<stroke
android:width="1dp"
android:color="#color/blue_400" />
</shape>
selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/shape_comm_bt_pressed"
android:state_pressed="true" />
<item android:drawable="#drawable/shape_comm_bt_normal"
android:state_pressed="false" />
</selector>
use
<Button
...
android:background="#drawable/selector_common_bt"
...
/>
I am trying to change the RadioButton color I have. I programmatically add RadioButtons, however after researching I am unable to change the color to a solid black border with a black filling when clicked. Here is my code where I add the buttons, I understand there may be considerations for both API Levels < 21 and > 21:
public void addRadioButtonsWithFirebaseAnswers(DataSnapshot dataSnapshot, int numberOfAnswers) {
mPollAnswerArrayList = new ArrayList<RadioButton>();
for (int i = 0; i < numberOfAnswers; i++) {
Log.e("Number of Answers", "The number of answers is " + numberOfAnswers);
mPollAnswerArrayList.add(i, new RadioButton(getActivity().getApplicationContext()));
mPollAnswerArrayList.get(i).setId(i);
String firebaseChild = String.valueOf(i + 1);
mPollAnswerArrayList.get(i).setText(dataSnapshot.child(POLL_ANSWERS_LABEL).child(firebaseChild).child("Answer").getValue().toString());
mPollAnswerArrayList.get(i).setTextColor(getResources().getColor(R.color.black));
mPollAnswerArrayList.get(i).setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.radio_button_answer_text_size));
mParams.setMargins((int) getResources().getDimension(R.dimen.radio_question_margin_left), 0, 0, (int) getResources().getDimension(R.dimen.radio_question_margin_bottom));
mPollQuestionRadioGroup.addView(mPollAnswerArrayList.get(i), mParams);
}
}
You can change the color of selected radio button using selector
selector_radio_btn/xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="#color/checkbox_active" />
<item android:state_checked="false" android:drawable="#color/checkbox_inactive" />
</selector>
checkbox_inactive.xml
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<solid
android:color="#android:color/transparent" />
<stroke
android:width="1dp"
android:color="#53aade" />
</shape>
checkbox_activi.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval" >
<solid android:color="#android:color/transparent" />
<stroke
android:width="1dp"
android:color="#53aade" />
</shape>
</item>
<item left="5dp" right="5dp" top="5dp" bottom="5dp">
<shape android:shape="oval" >
<solid android:color="#53aade" />
</shape>
</item>
</layer-list>
set selector_radio_btn.xml in radiobutton
mPollAnswerArrayList.get(i).setButtonDrawable(getResources().getDrawable(R.drawable.selector_radio_btn));
To address API < 21 and API > 21, I have done the following:
if (Build.VERSION.SDK_INT >= 21) {
mPollAnswerArrayList.get(indexCreated).setButtonTintMode(PorterDuff.Mode.DARKEN);
} else {
mPollAnswerArrayList.get(indexCreated).setButtonDrawable(R.drawable.black_ring);
}
I have also added the drawable as below:
black_ring.xml in my drawable folder:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="3dp"
android:useLevel="false" >
<solid android:color="#color/black" />
<size
android:height="25dp"
android:width="25dp" />
</shape>
this is my question:
At the first click on button I set the background of view
public void clickOnButton(View v){
if(compareDrawable(getResources().getDrawable(R.drawable.green_button), v.getBackground())) {
v.setBackgroundResource(R.drawable.red_button);
}else{
v.setBackgroundResource(R.drawable.green_button);
}
}
Where the compare function has this code:
public boolean compareDrawable(Drawable d1, Drawable d2){
try{
Bitmap bitmap1 = ((BitmapDrawable)d1).getBitmap();
ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
bitmap1.compress(Bitmap.CompressFormat.JPEG, 100, stream1);
stream1.flush();
byte[] bitmapdata1 = stream1.toByteArray();
stream1.close();
Bitmap bitmap2 = ((BitmapDrawable)d2).getBitmap();
ByteArrayOutputStream stream2 = new ByteArrayOutputStream();
bitmap2.compress(Bitmap.CompressFormat.JPEG, 100, stream2);
stream2.flush();
byte[] bitmapdata2 = stream2.toByteArray();
stream2.close();
return bitmapdata1.equals(bitmapdata2);
}
catch (Exception e) {
// TODO: handle exception
}
return false;
}
I've already try to use some of these comparations:
if(v.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.green_button).getConstantState()))
or
if(getResources().getDrawable(R.drawable.green_button).hashCode() == v.getBackground().hashCode())
and the code of xml files is like this:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#70c656" />
<stroke
android:width="1dp"
android:color="#53933f" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#70c656"
android:endColor="#53933f"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#53933f" />
<corners
android:radius="4dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
but they doesn't work, they return false every time. How can I compare these object?
Why would you need to compare Drawables just to change the image back and forth?
Instead use CheckBox or other CompoundButton and use selector xml with 4 states:
checked and pressed
checked
pressed
default
I'm changing things around inside of my onCreateOptionsMenu and I'm getting a really weird crash. Logcat tells me it crashed:
This is the crash :
at com.mycompany.myapp.MainActivity.onCreateOptionsMenu(MainActivity.java)
at android.app.Activity.onCreatePanelMenu(Activity.java:2476)
And that it's a null pointer exception.
Here's my onCreateOptionsMenu:
#Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.layout.main_menu, menu);
MenuItem shareNew = menu.findItem(R.id.shareNew);
MenuItem shareOld = menu.findItem(R.id.shareOld);
mShareActionProvider = (ShareActionProvider) shareNew.getActionProvider();
mShareActionProvider.setShareIntent(createShareIntent());
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
shareOld.setVisible(true);
shareNew.setVisible(false);
} else {
shareOld.setVisible(false);
shareNew.setVisible(true);
}
MenuItem searchItem = menu.findItem(R.id.action_search);
mSearchView = (SearchView) searchItem.getActionView();
mSearchView.setQueryHint("Search articles");
setupSearchView(searchItem);
return true;
}
And here's my main_menu.xml:
<item
android:id="#+id/starred"
android:title="Starred articles" />
<item
android:queryHint="Search articles"
android:id="#+id/action_search"
android:title="Search"
android:icon="#drawable/search"
android:showAsAction="always"
android:actionViewClass="android.widget.SearchView" />
<item
android:actionProviderClass="android.widget.ShareActionProvider"
android:id="#+id/shareNew"
android:title="Share"
android:showAsAction="ifRoom"
android:icon="#drawable/share"/>
<item
android:id="#+id/shareOld"
android:title="Share"
android:showAsAction="ifRoom"
android:icon="#drawable/share"/>
<item
android:id="#+id/star"
android:title="Star article"
android:showAsAction="ifRoom"
android:icon="#drawable/star" />
<item
android:id="#+id/refresh"
android:title="Refresh"
android:icon="#drawable/refresh"
android:showAsAction="ifRoom" />
<item
android:id="#+id/forward"
android:title="Forward"
android:icon="#drawable/forward"
android:showAsAction="ifRoom" />
<item
android:showAsAction="ifRoom"
android:icon="#drawable/copy"
android:id="#+id/copy"
android:title="Copy url" />
<item
android:id="#+id/browser"
android:title="Open in browser" />
<item
android:id="#+id/startPage"
android:title="Use as startpage" />
<item
android:id="#+id/random"
android:title="Random article" />
<item
android:id="#+id/settings"
android:title="Settings" />
Help would be really appreaciated (and needed :p)