import java.io.Serializable; import android.content.Context; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; /** * */ private static final long serialVersionUID = 2271402255369440088L; public static final int ACTION_TITLE = 0, ACTION_TIMER = 1, PAUSEANDPLAY_BTN = 2, FINISH_BTN = 3; super(context); } super(context, attr); } super(context, attr, defStyle); } // int hashedID = input.getActionName().hashCode(); // if (hashedID < 0) // hashedID *= -1; // this.setId(hashedID); this.setOrientation(LinearLayout.VERTICAL); this.setLayoutParams(new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); action = input; LayoutInflater inflater = LayoutInflater.from(getContext()); TextView actionTitle = (TextView) view .findViewById(com.tonimiko.mochi_bean.R.id.action_holder_title); actionTitle.setText(action.getActionName()); actionTitle.setId(ActionHolder.ACTION_TITLE); TextView actionTimer = (TextView) view .findViewById(R.id.action_holder_timer); actionTimer.setId(ActionHolder.ACTION_TIMER); .findViewById(com.tonimiko.mochi_bean.R.id.pause_and_play_timer_btn); pauseBtn.setId(ActionHolder.PAUSEANDPLAY_BTN); .findViewById(com.tonimiko.mochi_bean.R.id.finish_activity_button); finishBtn.setId(ActionHolder.FINISH_BTN); action.setActivityStartTime(); } action.setActivityStopTime(); return action; } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); } return "Action stored: " + action.getActionName(); } @Override ActionHolder otherObj = (ActionHolder) other; if (this.action.getActionName().toUpperCase() .equals(otherObj.action.getActionName().toUpperCase())) return true; return false; } @Override public int hashCode() { return action.getActionName().hashCode(); } @Override protected Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); Bundle data = new Bundle(); data.putString("Timer", timer); data.putSerializable("Action", action); Log.e("debug", "View onSaveInstanceState called!"); // TODO Parcelable test = new ActionHolderSavedState(superState, data); if(test==null) Log.e("debug", "NULL PARCELABLE"); // TODO return new ActionHolderSavedState(superState, data); } @Override protected void onRestoreInstanceState(Parcelable state) { Log.e("debug", "View onRestore called!"); if (state instanceof ActionHolderSavedState) { final ActionHolderSavedState savedState = (ActionHolderSavedState) state; this.action = savedState.getAction(); this.timer = savedState.getTimer(); // this.initiate(action); super.onRestoreInstanceState(savedState.getSuperState()); Log.e("debug", "View onRestoreInstanceState finished"); // TODO } } static class ActionHolderSavedState extends BaseSavedState { public ActionHolderSavedState(Parcelable superState, Bundle data) { super(superState); storedTimer = data.getString("Timer"); } private ActionHolderSavedState(Parcel in) { super(in); storedTimer = in.readString(); storedAction = in.readParcelable(ActionHolder.class.getClassLoader()); } return storedAction; } return storedTimer; } @Override public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeString(storedTimer); out.writeSerializable(storedAction); } // required field that makes Parcelables from a Parcel public static final Parcelable.Creator<ActionHolderSavedState> CREATOR = new Parcelable.Creator<ActionHolderSavedState>() { public ActionHolderSavedState createFromParcel(final Parcel in) { return new ActionHolderSavedState(in); } public ActionHolderSavedState[] newArray(int size) { return new ActionHolderSavedState[size]; } }; } }
Standard input is empty
Main.java:16: error: class ActionHolder is public, should be declared in a file named ActionHolder.java public class ActionHolder extends LinearLayout implements Serializable { ^ Main.java:3: error: package android.content does not exist import android.content.Context; ^ Main.java:4: error: package android.os does not exist import android.os.Bundle; ^ Main.java:5: error: package android.os does not exist import android.os.Parcel; ^ Main.java:6: error: package android.os does not exist import android.os.Parcelable; ^ Main.java:7: error: package android.util does not exist import android.util.AttributeSet; ^ Main.java:8: error: package android.util does not exist import android.util.Log; ^ Main.java:9: error: package android.util does not exist import android.util.SparseArray; ^ Main.java:10: error: package android.view does not exist import android.view.LayoutInflater; ^ Main.java:11: error: package android.view does not exist import android.view.View; ^ Main.java:12: error: package android.widget does not exist import android.widget.Button; ^ Main.java:13: error: package android.widget does not exist import android.widget.LinearLayout; ^ Main.java:14: error: package android.widget does not exist import android.widget.TextView; ^ Main.java:16: error: cannot find symbol public class ActionHolder extends LinearLayout implements Serializable { ^ symbol: class LinearLayout Main.java:22: error: cannot find symbol private Action action; ^ symbol: class Action location: class ActionHolder Main.java:29: error: cannot find symbol public ActionHolder(Context context) { ^ symbol: class Context location: class ActionHolder Main.java:35: error: cannot find symbol public ActionHolder(Context context, AttributeSet attr) { ^ symbol: class Context location: class ActionHolder Main.java:35: error: cannot find symbol public ActionHolder(Context context, AttributeSet attr) { ^ symbol: class AttributeSet location: class ActionHolder Main.java:41: error: cannot find symbol public ActionHolder(Context context, AttributeSet attr, int defStyle) { ^ symbol: class Context location: class ActionHolder Main.java:41: error: cannot find symbol public ActionHolder(Context context, AttributeSet attr, int defStyle) { ^ symbol: class AttributeSet location: class ActionHolder Main.java:47: error: cannot find symbol public void initiate(Action input) { ^ symbol: class Action location: class ActionHolder Main.java:81: error: cannot find symbol public Action finishAction() { ^ symbol: class Action location: class ActionHolder Main.java:120: error: cannot find symbol protected Parcelable onSaveInstanceState() { ^ symbol: class Parcelable location: class ActionHolder Main.java:135: error: cannot find symbol protected void onRestoreInstanceState(Parcelable state) { ^ symbol: class Parcelable location: class ActionHolder Main.java:147: error: cannot find symbol static class ActionHolderSavedState extends BaseSavedState { ^ symbol: class BaseSavedState location: class ActionHolder Main.java:149: error: cannot find symbol private Action storedAction; ^ symbol: class Action location: class ActionHolderSavedState Main.java:154: error: cannot find symbol public ActionHolderSavedState(Parcelable superState, Bundle data) { ^ symbol: class Parcelable location: class ActionHolderSavedState Main.java:154: error: cannot find symbol public ActionHolderSavedState(Parcelable superState, Bundle data) { ^ symbol: class Bundle location: class ActionHolderSavedState Main.java:162: error: cannot find symbol private ActionHolderSavedState(Parcel in) { ^ symbol: class Parcel location: class ActionHolderSavedState Main.java:170: error: cannot find symbol public Action getAction() { ^ symbol: class Action location: class ActionHolderSavedState Main.java:183: error: cannot find symbol public void writeToParcel(final Parcel out, final int flags) { ^ symbol: class Parcel location: class ActionHolderSavedState Main.java:190: error: package Parcelable does not exist public static final Parcelable.Creator<ActionHolderSavedState> CREATOR = new Parcelable.Creator<ActionHolderSavedState>() { ^ Main.java:52: error: cannot find symbol this.setOrientation(LinearLayout.VERTICAL); ^ symbol: variable LinearLayout location: class ActionHolder Main.java:53: error: package LinearLayout does not exist this.setLayoutParams(new LinearLayout.LayoutParams( ^ Main.java:54: error: cannot find symbol LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); ^ symbol: variable LayoutParams location: class ActionHolder Main.java:54: error: cannot find symbol LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); ^ symbol: variable LayoutParams location: class ActionHolder Main.java:56: error: cannot find symbol LayoutInflater inflater = LayoutInflater.from(getContext()); ^ symbol: class LayoutInflater location: class ActionHolder Main.java:56: error: cannot find symbol LayoutInflater inflater = LayoutInflater.from(getContext()); ^ symbol: method getContext() location: class ActionHolder Main.java:56: error: cannot find symbol LayoutInflater inflater = LayoutInflater.from(getContext()); ^ symbol: variable LayoutInflater location: class ActionHolder Main.java:57: error: cannot find symbol View view = inflater.inflate(R.layout.action_holder_layout, this, true); ^ symbol: class View location: class ActionHolder Main.java:57: error: package R does not exist View view = inflater.inflate(R.layout.action_holder_layout, this, true); ^ Main.java:59: error: cannot find symbol TextView actionTitle = (TextView) view ^ symbol: class TextView location: class ActionHolder Main.java:59: error: cannot find symbol TextView actionTitle = (TextView) view ^ symbol: class TextView location: class ActionHolder Main.java:60: error: package com.tonimiko.mochi_bean.R does not exist .findViewById(com.tonimiko.mochi_bean.R.id.action_holder_title); ^ Main.java:64: error: cannot find symbol TextView actionTimer = (TextView) view ^ symbol: class TextView location: class ActionHolder Main.java:64: error: cannot find symbol TextView actionTimer = (TextView) view ^ symbol: class TextView location: class ActionHolder Main.java:65: error: package R does not exist .findViewById(R.id.action_holder_timer); ^ Main.java:68: error: cannot find symbol Button pauseBtn = (Button) view ^ symbol: class Button location: class ActionHolder Main.java:68: error: cannot find symbol Button pauseBtn = (Button) view ^ symbol: class Button location: class ActionHolder Main.java:69: error: package com.tonimiko.mochi_bean.R does not exist .findViewById(com.tonimiko.mochi_bean.R.id.pause_and_play_timer_btn); ^ Main.java:72: error: cannot find symbol Button finishBtn = (Button) view ^ symbol: class Button location: class ActionHolder Main.java:72: error: cannot find symbol Button finishBtn = (Button) view ^ symbol: class Button location: class ActionHolder Main.java:73: error: package com.tonimiko.mochi_bean.R does not exist .findViewById(com.tonimiko.mochi_bean.R.id.finish_activity_button); ^ Main.java:90: error: cannot find symbol super.onLayout(changed, l, t, r, b); ^ symbol: variable super location: class ActionHolder Main.java:88: error: method does not override or implement a method from a supertype @Override ^ Main.java:103: error: inconvertible types ActionHolder otherObj = (ActionHolder) other; ^ required: ActionHolder found: Object Main.java:121: error: cannot find symbol Parcelable superState = super.onSaveInstanceState(); ^ symbol: class Parcelable location: class ActionHolder Main.java:121: error: cannot find symbol Parcelable superState = super.onSaveInstanceState(); ^ symbol: variable super location: class ActionHolder Main.java:122: error: cannot find symbol Bundle data = new Bundle(); ^ symbol: class Bundle location: class ActionHolder Main.java:122: error: cannot find symbol Bundle data = new Bundle(); ^ symbol: class Bundle location: class ActionHolder Main.java:125: error: cannot find symbol Log.e("debug", "View onSaveInstanceState called!"); // TODO ^ symbol: variable Log location: class ActionHolder Main.java:126: error: cannot find symbol Parcelable test = new ActionHolderSavedState(superState, data); ^ symbol: class Parcelable location: class ActionHolder Main.java:128: error: cannot find symbol Log.e("debug", "NULL PARCELABLE"); // TODO ^ symbol: variable Log location: class ActionHolder Main.java:119: error: method does not override or implement a method from a supertype @Override ^ Main.java:136: error: cannot find symbol Log.e("debug", "View onRestore called!"); ^ symbol: variable Log location: class ActionHolder Main.java:142: error: cannot find symbol super.onRestoreInstanceState(savedState.getSuperState()); ^ symbol: method getSuperState() location: variable savedState of type ActionHolderSavedState Main.java:142: error: cannot find symbol super.onRestoreInstanceState(savedState.getSuperState()); ^ symbol: variable super location: class ActionHolder Main.java:143: error: cannot find symbol Log.e("debug", "View onRestoreInstanceState finished"); // TODO ^ symbol: variable Log location: class ActionHolder Main.java:134: error: method does not override or implement a method from a supertype @Override ^ Main.java:157: error: cannot find symbol storedAction = (Action) data.getSerializable("Action"); ^ symbol: class Action location: class ActionHolderSavedState Main.java:184: error: cannot find symbol super.writeToParcel(out, flags); ^ symbol: variable super location: class ActionHolderSavedState Main.java:182: error: method does not override or implement a method from a supertype @Override ^ Main.java:190: error: package Parcelable does not exist public static final Parcelable.Creator<ActionHolderSavedState> CREATOR = new Parcelable.Creator<ActionHolderSavedState>() { ^ 73 errors
Standard output is empty