Note that there are some explanatory texts on larger screens.

plurals
  1. POsherlock action bar view
    primarykey
    data
    text
    <p>I am making an sherlock action bar with 2 menu items.But in the view of action bar both the items are present on extreme left location.I want to add 1 more menu item to the extreme left side of the action bar along with a text in the center of the action bar.This is the code:</p> <pre><code>package naseeb.bar; import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockActivity; public class NaseebactionbarActivity extends SherlockActivity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.newlayout); ActionBar actionbar = getSupportActionBar(); actionbar.setDisplayShowTitleEnabled(false); actionbar.setDisplayShowHomeEnabled(false); actionbar.show(); } public void newclickhandler(View view) { Toast.makeText(NaseebactionbarActivity.this, "press the button to choose the time limit for the timer", Toast.LENGTH_LONG).show(); Intent intent = new Intent(NaseebactionbarActivity.this,controltransfer.class); startActivity(intent); } @Override public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu ) { com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } @Override public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item){ // same as using a normal menu switch(item.getItemId()) { case R.id.menu1: LayoutInflater inflater=getLayoutInflater(); View view = inflater.inflate(R.layout.main,null); view.setMinimumWidth(200); view.setMinimumHeight(200); AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setView(view); alertDialog.show(); break; case R.id.menu2: Intent intent = new Intent(NaseebactionbarActivity.this,controltransfer.class); startActivity(intent); break; } return true; } public void makeToast(String message) { Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); } } </code></pre> <p>Please tell me how to solve this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload