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
<!-- values/attr.xml --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<attr name="my_image" format="reference" /> | |
</resources> | |
<!-- values/styles.xml --> | |
<style name="MyThemeBase" parent="@style/MyThemeBaseBase"> | |
<item name="my_image">@drawable/my_image_en</item> | |
</style> |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 22 | |
buildToolsVersion "22.0.1" | |
defaultConfig { | |
applicationId "pl.selvin.android.actionbar14" | |
minSdkVersion 14 | |
targetSdkVersion 22 |
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
class Service { | |
onStartCommand() { | |
enableGatheringOfSignalData(); | |
} | |
useSignalData(data) { | |
//do the stuff with signal data | |
} | |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="pl.selvin.android.sigletaskissingle"> | |
<application | |
android:allowBackup="true" | |
android:label="SingleTaskIsSingleTask"> | |
<activity | |
android:name=".Activities$ActivityA" | |
android:label="Activity A" | |
android:launchMode="singleTask"> |
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
project.ext.versionCode = project.hasProperty("versionCode") ? project.versionCode.toInteger() : 3 | |
project.ext.versionName = project.hasProperty("versionName") ? project.versionName : "1.0" | |
android { | |
defaultConfig { | |
versionCode project.versionCode | |
versionName project.versionName | |
} | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> |
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
def getVersionCode(int default_) { | |
return project.hasProperty('versionCode') ? versionCode.toInteger() : default_ | |
} | |
def getVersionName(String default_) { | |
return project.hasProperty('versionName') ? versionName : default_ | |
} | |
versionCode getVersionCode(3) | |
versionName getVersionName("1.0") |
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 MinimalArrayAdapter<T> extends BaseAdapter { | |
LayoutInflater inflater = null; | |
ArrayList<T> mObjects = null; | |
public MinimalArrayAdapter(Context ctx, ArrayList<T> list) { | |
mObjects = list; | |
inflater = LayoutInflater.from(ctx); | |
} | |
@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
public class TestActivity extends Activity { | |
final Object uiHandlerLock = new Object(); | |
Button butt; | |
HandlerThread thread; | |
Handler backgroundHandler; | |
Handler uiHandler; | |
@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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 22 | |
buildToolsVersion "22.0.1" | |
defaultConfig { | |
applicationId "pl.selvin.android.localbroadcastreceivertest" | |
minSdkVersion 4 | |
targetSdkVersion 22 |
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
SimpleAdapter adapter = ...; | |
adapter.setViewBinder(new SimpleAdapter.ViewBinder() { | |
@Override | |
public boolean setViewValue(View view, Object data, String textRepresentation) { | |
if(view.getId() == R.id.imageView1) { //view is our ImageView | |
((ImageView)view).setImageBitmap((Bitmap)data); | |
return true; | |
} | |
//Otherwise do default stuff |