This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log.d(TAG, "null activity"); | |
this.setActivity(null); | |
Log.d(TAG, "change orientation"); | |
this.activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); | |
Log.d(TAG, "restart activity"); | |
this.activity = this.getActivity(); | |
Log.d(TAG, "assertions"); | |
lv = ((ListActivity) this.activity).getListView(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.NullPointerException | |
at bbct.android.common.activity.test.BaseballCardListWithDataTest.testSelectionAfterSaveInstanceState(BaseballCardListWithDataTest.java:462) | |
at java.lang.reflect.Method.invokeNative(Native Method) | |
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) | |
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) | |
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) | |
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190) | |
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175) | |
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) | |
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package codeguru.exercise; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.View; | |
import com.google.zxing.client.android.CaptureActivity; | |
public class MainActivity extends Activity { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SubclassActivity extends MainActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
View textView = findViewById(R.id.button1); | |
textView.setOnClickListener(new OnClickListener() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup parent, | |
Bundle savedInstanceState) { | |
Log.d(TAG, "onCreateView()"); | |
View fragmentView = inflater.inflate(R.layout.image, parent, false); | |
ImageView imageView = (ImageView) fragmentView.findViewById(R.id.image); | |
imageView.setImageResource(imageId); | |
return fragmentView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".DangerousActivity" | |
android:label="@string/app_name" | |
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
<intent-filter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02-05 16:33:31.974: I/Lab-Fragments(2565): Entered onItemSelected(0) | |
02-05 16:33:32.324: I/Lab-Fragments(2565): Entered updateFeedDisplay() | |
02-05 16:33:34.614: I/Lab-Fragments(2565): Entered onActivityCreated() | |
02-05 16:33:36.454: I/Lab-Fragments(2565): Entered onItemSelected(1) | |
02-05 16:33:36.454: I/Lab-Fragments(2565): Entered updateFeedDisplay() | |
02-05 16:33:39.074: I/Lab-Fragments(2565): Entered onActivityCreated() | |
02-05 16:33:40.404: I/Lab-Fragments(2565): Entered onItemSelected(2) | |
02-05 16:33:40.404: I/Lab-Fragments(2565): Entered updateFeedDisplay() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle b = new Bundle(); | |
b.setString("name", name); | |
b.setInt("someInt", someInt); | |
Message m = new Message(); | |
m.setData(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
03-01 10:54:44.479: E/AndroidRuntime(1656): java.lang.RuntimeException: Unable to pause activity {course.labs.notificationslab/course.labs.notificationslab.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: null | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2838) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2794) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2772) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.app.ActivityThread.access$800(ActivityThread.java:130) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.os.Handler.dispatchMessage(Handler.java:99) | |
03-01 10:54:44.479: E/AndroidRuntime(1656): at android.os.Looper.loop(Looper.java:137) | |
03-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
GoogleMapOptions options = new GoogleMapOptions() | |
.mapType(GoogleMap.MAP_TYPE_SATELLITE); | |
SupportMapFragment mapFragment = SupportMapFragment | |
.newInstance(options); | |
GoogleMap map = mapFragment.getMap(); |