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
TextView text = (TextView) findViewById(R.id.my_text); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<item name="my_text" type="id" /> | |
</resources> |
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
<TextView android:id="@+id/my_text" ...> |
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 MyWidget(Context context, AttributeSet attrs, int defStyle) { | |
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MyWidget, defStyle); | |
// read attribute values | |
boolean userBoolAttr = a.getBoolean(R.styleable.bool_attr, false); | |
int userIntAttr = a.getInteger(R.styleable.int_attr, 0); | |
// do something with these values | |
// ... | |
} |
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
<com.example.MyWidget | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
bool_attr="true" | |
int_attr="1" /> |
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
<resources> | |
<declare-styleable name="MyWidget"> | |
<attr name="bool_attr" format="boolean" /> | |
<attr name="int_attr" format="integer" /> | |
</declare-styleable> | |
</resources> |
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 Base | |
def m | |
puts "Base::m" | |
end | |
end | |
module MixinA | |
def m | |
puts "MixinA::m" | |
end |
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
private void addStreamItemPhoto(String photoUrl, long streamItemId, String accountName) { | |
byte[] photoData = downloadPhoto(photoUrl); | |
ContentValues values = new ContentValues(); | |
values.put(StreamItems.ACCOUNT_NAME, accountName); | |
values.put(StreamItems.ACCOUNT_TYPE, "com.yourapp.account"); | |
values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId); | |
values.put(StreamItemPhotos.PHOTO, photoData); | |
resolver.insert(StreamItems.CONTENT_PHOTO_URI, values); | |
} |
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=".social.ViewStreamItemActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<data android:host="com.android.contacts" android:scheme="content" android:pathPattern="/stream_items/*"/> | |
</intent-filter> | |
</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
import com.github.ignition.core.tasks.IgnitedAsyncTask; | |
public class IgnitedAsyncTaskActivity extends Activity { | |
private SampleTask task; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); |