android-actionbaractivity

Robolectric 3.0-rc2 Hamcrest-core conflict

人走茶凉 提交于 2019-12-11 03:17:22
问题 Hello I'm trying to get ActionBar Activity UnitTests going and I'm using Robolectirc-RC2 , but when i try to sync my android studio I'm getting the following error/warning. Warning:Conflict with dependency org.hamcrest:hamcrest-core . Resolved versions for app and test app differ. Any idea how to resolve it? repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots" } mavenLocal() mavenCentral() } dependencies { // Unit testing dependencies unitTestCompile('junit

Android equivalent of getActivity() from/in ActionBarActivity

余生长醉 提交于 2019-12-08 17:33:46
问题 Like my title says, i'm looking for an equivalent of getActivity() in my ActionBarActivity class in my Android project . I want to pass an Activity parameter in AsyncTask declaration object, because i'm using an Activity object in my custom AsyncTask extended class Here an example simplest code of my project public class EventCreator extends ActionBarActivity { private Context context; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

getSupportActionBar().setCustomView(view) does not fill entire actionbar

自闭症网瘾萝莉.ら 提交于 2019-12-08 17:26:22
问题 I'm trying to set the customview of my app and the layout i made does not fill the entire actionbar. I've tried so many style settings but none has worked for me. here's my code in activity View view = getLayoutInflater().inflate(R.layout.actionbar_customized_home, null); getSupportActionBar().setDisplayShowCustomEnabled(true); getSupportActionBar().setCustomView(view); here's the layout placed set as view <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android

Android: Icons don't appear in Action Bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 20:30:54
I'm following the google tutorial for action bars but the icons don't appear on it, this is the menu xml file: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_refresh" android:icon="@drawable/ic_action_refresh" android:title="refresh" android:showAsAction="ifRoom"/> <item android:id="@+id/action_settings" android:icon="@drawable/ic_action_settings" android:title="settings" android:showAsAction="ifRoom"/> <item android:id="@+id/action_compose" android:icon="@drawable/ic_action_new" android

v7-21 ActionBarActivity not showing the app main icon on the left

半城伤御伤魂 提交于 2019-12-04 17:33:35
I implemented a basic activity as public class MainActivity extends Activity and when I add an actionbar with the menu as below, the app icon defined in the AndroidManifest.xml shows up nicely <application android:allowBackup="true" android:icon="@drawable/logo_green" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.DarkActionBar" > When I try to change to android.support.v7.app.ActionBarActivity ( and switch to compatible AppCompat theme like @style/Theme.AppCompat.Light.DarkActionBar) the main app menu in the action bar

Extended Toolbar with Custom View not Displaying with Full Width

为君一笑 提交于 2019-12-02 22:37:28
I went through lots of answers here related to Toolbar but none of the answers could help me. What I'm trying to achieve is to have an extended toolbar whhich will display a logo, possibly a name of the Activity/App, it will have an action button/drawer toggle to the right that will display a navigation-like drawer to the right, an overflow menu with other options like settings and also a navigation Tab at the bottom that will allow the user to move between different fragments (different days in a month). The way I'm trying to achieve this is through toolbar. First I create the toolbar and add

Android:ActionBarActivity findViewById return NULL

眉间皱痕 提交于 2019-12-01 14:39:00
I can't to get the button from fragment, what's wrong? Recieve a uncaught exception - nullpointerexception; Button can't be found. Early all will be find, but after update android sdk, all is changed (( package com.example.test; import java.io.IOException; import android.media.MediaPlayer; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import

ActionBarActivity - NoClassDefFoundError exception

假装没事ソ 提交于 2019-12-01 10:12:22
Already seen: NoClassDefFoundError Android with ActionBarActivity and ActionBarActivity catch an error on Phone I am trying to use ActionBarCompact in my project. I have linked android-support-v7 project as well as its jar in my project following and checking the steps from lots of sources, but still I am unable to deal with the problem. When I built my project, there is no error, but there is exception at runtime. Don't know why class is not detected. Please tell me what is wrong. Thanks. Code: import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app

How to rectify NullPointerException in v4.DrawerLayout? [duplicate]

孤街浪徒 提交于 2019-12-01 02:55:42
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 4 months ago . I am trying to implement a navigation drawer but for some reasons am getting this null pointer exception . I have spent a lot of time on it but in vain. This is a part of my code. I can't understand why it is returning null pointer exception. Do I need to import any library or so? Thanks in advance. package com.motobeans.productions.aloha; import android.app

My MainActivity class throws java.lang.ClassNotFoundException when extends ActionBarActivity

╄→гoц情女王★ 提交于 2019-12-01 01:11:19
I followed the instructions indicated in other threads on how to import external libraries, but after importing android-support-v7-appcompat.jar into the Referenced Libraries of my Android project (in ADT v.22.0.5) I get java.lang.ClassNotFoundException: import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; import android.view.Menu; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar