Skip to content

Instantly share code, notes, and snippets.

@codeguru42
codeguru42 / IllegalAccessError.txt
Created June 7, 2014 04:05
IllegalAccessError
I/ActivityThread( 2051): Pub bbct.android.premium.provider: bbct.android.premium.provider.PremiumProvider
W/dalvikvm( 2051): Class resolved by unexpected DEX: Lbbct/android/premium/provider/PremiumProvider;(0xb5661828):0xad7a0000 ref [Lbbct/android/common/provider/BaseballCardProvider;] Lbbct/android/common/provider/BaseballCardProvider;(0xb5661828):0xad997000
W/dalvikvm( 2051): (Lbbct/android/premium/provider/PremiumProvider; had used a different Lbbct/android/common/provider/BaseballCardProvider; during pre-verification)
W/dalvikvm( 2051): Unable to resolve superclass of Lbbct/android/premium/provider/PremiumProvider; (951)
W/dalvikvm( 2051): Link of class 'Lbbct/android/premium/provider/PremiumProvider;' failed
D/AndroidRuntime( 2051): Shutting down VM
W/dalvikvm( 2051): threadid=1: thread exiting with uncaught exception (group=0xb4ea0288)
E/AndroidRuntime( 2051): FATAL EXCEPTION: main
E/AndroidRuntime( 2051): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementati
@codeguru42
codeguru42 / FilterCards.java
Last active August 29, 2015 14:02
testBrandCheckBox()
@Override
public void onPrepareOptionsMenu(Menu menu) {
MenuItem confirm = menu.findItem(R.id.save_menu);
if (this.numberChecked() > 0) {
confirm.setVisible(true);
confirm.setEnabled(true);
} else {
confirm.setVisible(false);
confirm.setEnabled(false);
06-04 16:06:31.808 2522-2522/bbct.android.common E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{bbct.android.common/bbct.android.common.activity.FilterCards}: java.lang.ClassCastException: bbct.android.common.activity.FilterCards cannot be cast to android.app.Activity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
@codeguru42
codeguru42 / OnCreate.java
Created May 26, 2014 22:06
onItemClick()
this.oldCard = (BaseballCard) this.getIntent().getSerializableExtra(
this.getString(R.string.baseball_card_extra));
if (this.oldCard != null) {
this.isUpdating = true;
this.cardId = this.getIntent().getLongExtra(
this.getString(R.string.card_id_extra), -1L);
this.autographCheckBox.setChecked(this.oldCard.isAutographed());
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="codeguru.thecubeserver.app.ChatFragment">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment"/>
fibd n m = sum $ fibd' !! (n-1)
where fibd' = [[fibd'' i j | i <- [0..m]] | j <- [0..n]]
-- `fibd'' i j` is the number of rabbits which are `i` months old after `j` months since the first generation
fibd'' 0 0 = 1
fibd'' _ 0 = 0
fibd'' 0 j = sum . tail $ fibd' !! (j-1)
fibd'' i j = fibd' !! (j-1) !! (i-1)
main = do
print $ fibd n m
@codeguru42
codeguru42 / onResume.java
Created April 13, 2014 17:06
onResume()
@Override
public void onResume() {
super.onResume();
// restore default header state
CheckedTextView headerCheck = (CheckedTextView) this.headerView
.findViewById(R.id.checkmark);
headerCheck.setChecked(false);
boolean[] newSelection = new boolean[this.adapter.getCount()];
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'java'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
@codeguru42
codeguru42 / map_activity.xml
Created March 8, 2014 03:45
A MapFragment with a Button
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
@codeguru42
codeguru42 / dynamicMapFragment
Created March 8, 2014 03:04
Dynamic Map Fragment
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();