<receiver
android:name=".SimpleReceiver"
android:enabled="true"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.honeywell.sample.action.BARCODE_DATA" />
</intent-filter>
</receiver>
public class SimpleReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent receivedIntent) {
String aimId = receivedIntent.getStringExtra("aimId");
String charset = receivedIntent.getStringExtra("charset");
String codeId = receivedIntent.getStringExtra("codeId");
String barcode = receivedIntent.getStringExtra("data");
byte[] dataBytes = receivedIntent.getByteArrayExtra("dataBytes");
String timestamp = receivedIntent.getStringExtra("timestamp");
int version = receivedIntent.getIntExtra("version", 1);
Log.d("BARCODE HANDLER: ", "Barcode handled: " + barcode);
}
}
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Label">
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
Displays a vertically-scrollable collection of views, where each view is positioned immediatelybelow the previous view in the list. For a more modern, flexible, and performant approach to displaying lists, use RecyclerView
public int getCount()
public View getView(int i, View view, ViewGroup viewGroup)
Collections.sort(filmItems , new Comparator<FilmItem>() {
@Override
public int compare(FilmItem i1, FilmItem i2) {
return i1.name.compareToIgnoreCase(i2.name);
}
});
public class Queue<T> {
T q[]; // Array to storage elements in queue
int putloc, getloc;
// indexes of placement and extracting queue elements
Queue(int size) { q = (T[])new Object[size+1];;
// allocate memory for queue
putloc = getloc = 0; }
// put symbol in queue
void put(T ch) {
if(putloc==q.length-1) {
System.out.println(" - Queue is full.");
return; }
putloc++;
q[putloc] = ch; }
// extract symbol from the queue
T get() {
if(getloc == putloc) {
System.out.println(" - Queue is empty.");
return null; }
getloc++;
return q[getloc];
}
}
Queue<int> queue = new Queue<>(5); // не правильно
Queue<Integer> queue = new Queue<>(5); // правильно
Caused by: android.os.NetworkOnMainThreadException