error in kitkat device not in greater version of android.
after changing gradle file. library used for circle pager indicator. https://github.com/JakeWharton/ViewPagerIndicator
dependencies { classpath 'com.android.tools.build:gradle:1.0.0'}
to dependencies {classpath 'com.android.tools.build:gradle:1.3.0'}
Error is:
Binary XML file line #43: Error inflating class com.viewpagerindicator.CirclePageIndicator
Caused by: java.lang.NoClassDefFoundError: com.app.skedule.R$styleable
10-03 12:29:47.501 28314-28314/? E/AndroidRuntime:
at com.viewpagerindicator.CirclePageIndicator.<init>(CirclePageIndicator.java:93)
10-03 12:29:47.501 28314-28314/? E/AndroidRuntime:
at com.viewpagerindicator.CirclePageIndicator.<init>(CirclePageIndicator.java:74)
CirclePageIndicator.java(inside my project->java->viewpagerindicator package)
package com.viewpagerindicator;
public class CirclePageIndicator extends View implements PageIndicator {
private static final int INVALID_POINTER = -1;
private float mRadius;
private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG);
private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG);
private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG);
private ViewPager mViewPager;
private ViewPager.OnPageChangeListener mListener;
private int mCurrentPage;
private int mSnapPage;
private float mPageOffset;
private int mScrollState;
private int mOrientation;
private boolean mCentered;
private boolean mSnap;
private int mTouchSlop;
private float mLastMotionX = -1;
private int mActivePointerId = INVALID_POINTER;
private boolean mIsDragging;
public CirclePageIndicator(Context context) {
this(context, null);
}
public CirclePageIndicator(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.vpiCirclePageIndicatorStyle);
}
public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (isInEditMode()) return;
//Load defaults from resources
final Resources res = getResources();
final int defaultPageColor = res.getColor(R.color.default_circle_indicator_page_color);
final int defaultFillColor = res.getColor(R.color.default_circle_indicator_fill_color);
final int defaultOrientation = res.getInteger(R.integer.default_circle_indicator_orientation);
final int defaultStrokeColor = res.getColor(R.color.default_circle_indicator_stroke_color);
final float defaultStrokeWidth = res.getDimension(R.dimen.default_circle_indicator_stroke_width);
final float defaultRadius = res.getDimension(R.dimen.default_circle_indicator_radius);
final boolean defaultCentered = res.getBoolean(R.bool.default_circle_indicator_centered);
final boolean defaultSnap = res.getBoolean(R.bool.default_circle_indicator_snap);
//Retrieve styles attributes
`TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CirclePageIndicator, defStyle, 0); //Error here`
By reference of this Link
added
dependencies { compile 'com.android.support:multidex:1.0.0'} defaultConfig { multiDexEnabled true}
and
public class MyApplication extends MultiDexApplication {
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}`
finally got solution.
Related
public class SwipeButton extends RelativeLayout {
private ImageView swipeButtonInner;
private float initialX;
private boolean active;
private TextView centerText;
private ViewGroup background;
private Drawable disabledDrawable;
private Drawable enabledDrawable;
private OnStateChangeListener onStateChangeListener;
private OnActiveListener onActiveListener;
private static final int ENABLED = 0;
private static final int DISABLED = 1;
private int collapsedWidth;
private int collapsedHeight;
private LinearLayout layer;
private boolean trailEnabled = false;
private boolean hasActivationState;
public SwipeButton(Context context) {
super(context);
init(context, null, -1, -1);
}
public SwipeButton(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, -1, -1);
}
public SwipeButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs, defStyleAttr, -1);
}
#TargetApi(21)
public SwipeButton(Context context, AttributeSet attrs, int defStyleAttr, int
defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context, attrs, defStyleAttr, defStyleRes);
}
public boolean isActive() {
return active;
}
public void setText(String text) {
centerText.setText(text);
}
public void setBackground(Drawable drawable) {
background.setBackground(drawable);
}
public void setSlidingButtonBackground(Drawable drawable) {
background.setBackground(drawable);
}
public void setDisabledDrawable(Drawable drawable) {
disabledDrawable = drawable;
if (!active) {
swipeButtonInner.setImageDrawable(drawable);
}
}
public void setButtonBackground(Drawable buttonBackground) {
if (buttonBackground != null) {
swipeButtonInner.setBackground(buttonBackground);
}
}
public void setEnabledDrawable(Drawable drawable) {
enabledDrawable = drawable;
if (active) {
swipeButtonInner.setImageDrawable(drawable);
}
}
public void setOnStateChangeListener(OnStateChangeListener
onStateChangeListener) {
this.onStateChangeListener = onStateChangeListener;
}
public void setOnActiveListener(OnActiveListener onActiveListener) {
this.onActiveListener = onActiveListener;
}
public void setInnerTextPadding(int left, int top, int right, int bottom) {
centerText.setPadding(left, top, right, bottom);
}
public void setSwipeButtonPadding(int left, int top, int right, int bottom) {
swipeButtonInner.setPadding(left, top, right, bottom);
}
public void setHasActivationState(boolean hasActivationState) {
this.hasActivationState = hasActivationState;
}
My XML:`
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:id="#+id/AnswerRelativeLayout"
android:layout_height="70dp"
android:orientation="vertical"
tools:context="com.example.dynamicobj.FragmentMain">
<com.example.dynamicobj.SwipeButton
android:id="#+id/test_btn"
android:layout_width="match_parent"
android:layout_height="70dp"
app:button_background="#drawable/shape_button"
app:button_image_disabled="#drawable/ic_launcher_background"
app:button_image_height="60dp"
app:button_image_width="100dp"
app:has_activate_state="true"
app:initial_state="disabled"
app:inner_text="Termine buchen"
app:inner_text_background="#drawable/shape_rounded"
app:inner_text_bottom_padding="18dp"
app:inner_text_right_padding="200dp"
app:inner_text_color="#android:color/black"
app:inner_text_size="16sp"
app:inner_text_top_padding="18dp" />
</LinearLayout>`
F
ragmentMain:
public class FragmentMain extends Fragment {
Context context;
View rootView;
public FragmentMain() {
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(false);
}
#Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_main, container, false);
LinearLayout layout = (LinearLayout)
rootView.findViewById(R.id.AnswerRelativeLayout);
SwipeButton button = new SwipeButton(getContext());
layout.addView(button);
return rootView;
}
}
So I got this custom SwipeButton class from Git (com.ebanx.swipebtn.SwipeButton). Now I want to create an Object from SwipeButton with a layout looking like the one from the xml file. Is there any method, where I just can give the new button the prefinished layout without having to use all these Methods in the SwipeButton class? I am going to create the buttons dynamically later on, but all being the same layout. Help pls?
you forgot to add LayoutParams to your button
use below code before adding button into layout
button.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT))
and set your LinearLayout height wrap_content not 70dp
I have a MtxVideoView class which contains textview and surfaceview. The MtxVideoView class extends FrameLayout. I want to change size of MtxVideoView . How can do that ?
Following the code of special view
public class MtxVideoView extends FrameLayout implements SurfaceHolder.Callback, MediaPlayer.OnPreparedListener,
VideoControllerView.MediaPlayerControl, MediaPlayer.OnErrorListener {
private Context mContext;
private SurfaceHolder mSurfaceHolder;
private SurfaceView mSurfaceView;
private MediaPlayer mPlayer;
private VideoControllerView controller;
private TextView mMessage;
private boolean mbSrcAvailable = false;
private boolean mbSurfaceCreated = false;
private String mSource = "";
private String mUserName = "";
private String mPassword = "";
private boolean mbFullscreen = false;
private FullScreenListener mFullScreenListener;
private int mCount = 0;
static interface FullScreenListener {
void onFullScreen( View view, boolean bFullScreen);
}
public void setFullScreenListener( FullScreenListener listener ){
mFullScreenListener = listener;
}
public MtxVideoView(Context context) {
super(context);
mContext = context;
mbFullscreen = false;
Init();
}
public MtxVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
Init();
}
public MtxVideoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
Init();
}
private void Init(){
mSurfaceView = new SurfaceView(mContext);
mSurfaceView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ));
addView(mSurfaceView);
mMessage = new TextView(mContext);
mMessage.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ));
mMessage.setGravity(Gravity.CENTER);
mMessage.setTextColor(Color.WHITE);
this.addView(mMessage);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
}
}
Try this code.
But you have to run it when view is already measured.
{
LayoutParams param = getLayoutParams();
param.width = 100;
param.height = 200;
requestLayout();
}
When defining in xml use layout_width and layout_hight.
If you are adding dynamically then set layout parameters or add this view with layout parameters to its parent.
I this specific example I want set hint text color progrommatically but I couldn't change it.
public class FloatingHintEditText extends EditText {
private static enum Animation { NONE, SHRINK, GROW }
private final Paint mFloatingHintPaint = new Paint();
private final ColorStateList mHintColors;
private final float mHintScale;
private final int mAnimationSteps;
private boolean mWasEmpty;
private int mAnimationFrame;
private Animation mAnimation = Animation.NONE;
public FloatingHintEditText(Context context) {
this(context, null);
}
public FloatingHintEditText(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.floatingHintEditTextStyle);
}
public FloatingHintEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedValue typedValue = new TypedValue();
getResources().getValue(R.dimen.floatinghintedittext_hint_scale, typedValue, true);
mHintScale = typedValue.getFloat();
mAnimationSteps = getResources().getInteger(R.dimen.floatinghintedittext_animation_steps);
mHintColors = getHintTextColors();
mWasEmpty = TextUtils.isEmpty(getText());
}
#Override
public int getCompoundPaddingTop() {
final FontMetricsInt metrics = getPaint().getFontMetricsInt();
final int floatingHintHeight = (int) ((metrics.bottom - metrics.top) * mHintScale);
return super.getCompoundPaddingTop() + floatingHintHeight;
}
#Override
protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
final boolean isEmpty = TextUtils.isEmpty(getText());
// The empty state hasn't changed, so the hint stays the same.
if (mWasEmpty == isEmpty) {
return;
}
mWasEmpty = isEmpty;
// Don't animate if we aren't visible.
if (!isShown()) {
return;
}
if (isEmpty) {
mAnimation = Animation.GROW;
setHintTextColor(Color.TRANSPARENT);
} else {
mAnimation = Animation.SHRINK;
}
}
#Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (TextUtils.isEmpty(getHint())) {
return;
}
final boolean isAnimating = mAnimation != Animation.NONE;
// The large hint is drawn by Android, so do nothing.
if (!isAnimating && TextUtils.isEmpty(getText())) {
return;
}
mFloatingHintPaint.set(getPaint());
mFloatingHintPaint.setColor(
mHintColors.getColorForState(getDrawableState(), mHintColors.getDefaultColor()));
final float hintPosX = getCompoundPaddingLeft() + getScrollX();
final float normalHintPosY = getBaseline();
final float floatingHintPosY = normalHintPosY + getPaint().getFontMetricsInt().top + getScrollY();
final float normalHintSize = getTextSize();
final float floatingHintSize = normalHintSize * mHintScale;
// If we're not animating, we're showing the floating hint, so draw it and bail.
if (!isAnimating) {
mFloatingHintPaint.setTextSize(floatingHintSize);
canvas.drawText(getHint().toString(), hintPosX, floatingHintPosY, mFloatingHintPaint);
return;
}
if (mAnimation == Animation.SHRINK) {
drawAnimationFrame(canvas, normalHintSize, floatingHintSize,
hintPosX, normalHintPosY, floatingHintPosY);
} else {
drawAnimationFrame(canvas, floatingHintSize, normalHintSize,
hintPosX, floatingHintPosY, normalHintPosY);
}
mAnimationFrame++;
if (mAnimationFrame == mAnimationSteps) {
if (mAnimation == Animation.GROW) {
setHintTextColor(mHintColors);
}
mAnimation = Animation.NONE;
mAnimationFrame = 0;
}
invalidate();
}
private void drawAnimationFrame(Canvas canvas, float fromSize, float toSize,
float hintPosX, float fromY, float toY) {
final float textSize = lerp(fromSize, toSize);
final float hintPosY = lerp(fromY, toY);
mFloatingHintPaint.setTextSize(textSize);
canvas.drawText(getHint().toString(), hintPosX, hintPosY, mFloatingHintPaint);
}
private float lerp(float from, float to) {
final float alpha = (float) mAnimationFrame / (mAnimationSteps - 1);
return from * (1 - alpha) + to * alpha;
}
}
So when I call from my activity mEditText.setHintTextColor(getResources().getColor(R.color.red)) the color doesn't change
The color changes when I set only from xml.
I tried to do mEditText.invalidate() but it doesn't help too.
What should I do here to make my hintTextColor red.
Make your fields not final and try this:
public FloatingHintEditText(Context context) {
super(context);
init();
}
public FloatingHintEditText(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public FloatingHintEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init() {
TypedValue typedValue = new TypedValue();
getResources().getValue(R.dimen.floatinghintedittext_hint_scale, typedValue, true);
mHintScale = typedValue.getFloat();
mAnimationSteps = getResources().getInteger(R.dimen.floatinghintedittext_animation_steps);
mHintColors = getHintTextColors();
mWasEmpty = TextUtils.isEmpty(getText());
}
I have created the page indicator for the viewpager.In which i am changing the indicator image when user swipe in viewpager.
Below is my code for onPageSelected#ViewPager.OnPageChangeListener
public void onPageSelected(int position) {
int childCount = this.layout.getChildCount();
for (int i = 0; i < childCount; i++) {
PageItem child = (PageItem) this.layout.getChildAt(position);
if (i == position) {
child.setActiveState();
} else {
child.resetState();
}
}
this.layout.invalidate();
}
Below is my PageItem class
public class PageItem extends ImageView {
private int activeBitmap;
private int inActiveBitmap;
private boolean isActive;
public PageItem(Context context, AttributeSet attrs, int defStyle,
int activeBitmapId, int inActiveBitmapId) {
super(context, attrs, defStyle);
this.activeBitmap = activeBitmapId;
this.inActiveBitmap = inActiveBitmapId;
this.setImageResource(inActiveBitmap);
isActive = false;
}
public PageItem(Context context, AttributeSet attrs, int activeBitmapId,
int inActiveBitmapId) {
super(context, attrs);
this.activeBitmap = activeBitmapId;
this.inActiveBitmap = inActiveBitmapId;
this.setImageResource(inActiveBitmap);
isActive = false;
}
public PageItem(Context context, int activeBitmapId, int inActiveBitmapId) {
super(context);
this.activeBitmap = activeBitmapId;
this.inActiveBitmap = inActiveBitmapId;
this.setImageResource(inActiveBitmap);
isActive = false;
}
public void resetState() {
this.setImageDrawable(this.getContext().getResources()
.getDrawable(inActiveBitmap));
this.invalidate();
isActive = false;
}
public void setActiveState() {
this.setImageDrawable(this.getContext().getResources()
.getDrawable(activeBitmap));
this.invalidate();
isActive = true;
}
}
Now after starting my application when i do swipe first time it change the image but then after it does not change the image.
thanks in advance.
Looks like it should be:
PageItem child = (PageItem) this.layout.getChildAt(i);
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.applexus.PROJMANAGER/com.applexus.PROJMANAGER.CalendarType}:
android.view.InflateException: Binary XML file line #60: Error inflating class
com.applexus.Scheduler.CalendarView
I get this error when clicking my Calendar activity.
This is a calender view which am using in my activity and I
get the error while opening the activity. Here is the code:
public class CalendarView extends ImageView {
private static int WEEK_TOP_MARGIN = 74;
private static int WEEK_LEFT_MARGIN = 40;
private static int CELL_WIDTH = 58;
private static int CELL_HEIGH = 53;
private static int CELL_MARGIN_TOP = 92;
private static int CELL_MARGIN_LEFT = 39;
private static float CELL_TEXT_SIZE;
private static final String TAG = "CalendarView";
private Calendar mRightNow = null;
private Drawable mWeekTitle = null;
private Cell mToday = null;
private Cell[][] mCells = new Cell[6][7];
private OnCellTouchListener mOnCellTouchListener = null;
MonthDisplayHelper mHelper;
Drawable mDecoration = null;
public interface OnCellTouchListener {
public void onTouch(Cell cell);
}
public CalendarView(Context context) {
this(context, null);
}
public CalendarView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CalendarView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mDecoration = context.getResources().getDrawable(R.drawable.typeb_calendar_today);
initCalendarView();
}
private void initCalendarView() {
mRightNow = Calendar.getInstance();
// prepare static vars
Resources res = getResources();
WEEK_TOP_MARGIN = (int) res.getDimension(R.dimen.week_top_margin);
WEEK_LEFT_MARGIN = (int) res.getDimension(R.dimen.week_left_margin);
CELL_WIDTH = (int) res.getDimension(R.dimen.cell_width);
CELL_HEIGH = (int) res.getDimension(R.dimen.cell_heigh);
CELL_MARGIN_TOP = (int) res.getDimension(R.dimen.cell_margin_top);
CELL_MARGIN_LEFT = (int) res.getDimension(R.dimen.cell_margin_left);
CELL_TEXT_SIZE = res.getDimension(R.dimen.cell_text_size);
// set background
setImageResource(R.drawable.background);
mWeekTitle = res.getDrawable(R.drawable.calendar_week);
mHelper = new MonthDisplayHelper(mRightNow.get(Calendar.YEAR), mRightNow.get(Calendar.MONTH));
}
private void initCells() {
class _calendar {
public int day;
public boolean thisMonth;
public _calendar(int d, boolean b) {
day = d;
thisMonth = b;
}
public _calendar(int d) {
this(d, false);
}
};
_calendar tmp[][] = new _calendar[6][7];
for(int i=0; i<tmp.length; i++) {
int n[] = mHelper.getDigitsForRow(i);
for(int d=0; d<n.length; d++) {
if(mHelper.isWithinCurrentMonth(i,d))
tmp[i][d] = new _calendar(n[d], true);
else
tmp[i][d] = new _calendar(n[d]);
}
}
Calendar today = Calendar.getInstance();
int thisDay = 0;
mToday = null;
if(mHelper.getYear()==today.get(Calendar.YEAR) && mHelper.getMonth()==today.get(Calendar.MONTH)) {
thisDay = today.get(Calendar.DAY_OF_MONTH);
}
// build cells
Rect Bound = new Rect(CELL_MARGIN_LEFT, CELL_MARGIN_TOP, CELL_WIDTH+CELL_MARGIN_LEFT, CELL_HEIGH+CELL_MARGIN_TOP);
for(int week=0; week<mCells.length; week++) {
for(int day=0; day<mCells[week].length; day++) {
if(tmp[week][day].thisMonth) {
if(day==0 || day==6 )
mCells[week][day] = new RedCell(tmp[week][day].day, new Rect(Bound), CELL_TEXT_SIZE);
else
mCells[week][day] = new Cell(tmp[week][day].day, new Rect(Bound), CELL_TEXT_SIZE);
} else {
mCells[week][day] = new GrayCell(tmp[week][day].day, new Rect(Bound), CELL_TEXT_SIZE);
}
Bound.offset(CELL_WIDTH, 0); // move to next column
// get today
if(tmp[week][day].day==thisDay && tmp[week][day].thisMonth) {
mToday = mCells[week][day];
mDecoration.setBounds(mToday.getBound());
}
}
Bound.offset(0, CELL_HEIGH); // move to next row and first column
Bound.left = CELL_MARGIN_LEFT;
Bound.right = CELL_MARGIN_LEFT+CELL_WIDTH;
}
}
#Override
public void onLayout(boolean changed, int left, int top, int right, int bottom) {
Rect re = getDrawable().getBounds();
WEEK_LEFT_MARGIN = CELL_MARGIN_LEFT = (right-left - re.width()) / 2;
mWeekTitle.setBounds(WEEK_LEFT_MARGIN, WEEK_TOP_MARGIN, WEEK_LEFT_MARGIN+mWeekTitle.getMinimumWidth(), WEEK_TOP_MARGIN+mWeekTitle.getMinimumHeight());
initCells();
super.onLayout(changed, left, top, right, bottom);
}
public void setTimeInMillis(long milliseconds) {
mRightNow.setTimeInMillis(milliseconds);
initCells();
this.invalidate();
}
public int getYear() {
return mHelper.getYear();
}
public int getMonth() {
return mHelper.getMonth();
}
public void nextMonth() {
mHelper.nextMonth();
initCells();
invalidate();
}
public void previousMonth() {
mHelper.previousMonth();
initCells();
invalidate();
}
public boolean firstDay(int day) {
return day==1;
}
public boolean lastDay(int day) {
return mHelper.getNumberOfDaysInMonth()==day;
}
public void goToday() {
Calendar cal = Calendar.getInstance();
mHelper = new MonthDisplayHelper(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH));
initCells();
invalidate();
}
public Calendar getDate() {
return mRightNow;
}
#Override
public boolean onTouchEvent(MotionEvent event) {
if(mOnCellTouchListener!=null){
for(Cell[] week : mCells) {
for(Cell day : week) {
if(day.hitTest((int)event.getX(), (int)event.getY())) {
mOnCellTouchListener.onTouch(day);
}
}
}
}
return super.onTouchEvent(event);
}
public void setOnCellTouchListener(OnCellTouchListener p) {
mOnCellTouchListener = p;
}
#Override
protected void onDraw(Canvas canvas) {
// draw background
super.onDraw(canvas);
mWeekTitle.draw(canvas);
// draw cells
for(Cell[] week : mCells) {
for(Cell day : week) {
day.draw(canvas);
}
}
// draw today
if(mDecoration!=null && mToday!=null) {
mDecoration.draw(canvas);
}
}
public class GrayCell extends Cell {
public GrayCell(int dayOfMon, Rect rect, float s) {
super(dayOfMon, rect, s);
mPaint.setColor(Color.LTGRAY);
}
}
private class RedCell extends Cell {
public RedCell(int dayOfMon, Rect rect, float s) {
super(dayOfMon, rect, s);
mPaint.setColor(0xdddd0000);
}
}
}
Did you checked the xml file? Is there are problems with that? Your log says inflate exception, so I think it probably caused by your xml layout or something wrong with the inflating process. you can post your activity's source code here, and we will see what we can do to help