updated deps
removed workaround for issue with the navigationHeader added handling of empty responses
This commit is contained in:
@@ -97,8 +97,7 @@ public class ColorActivity extends AppCompatActivity implements NavigationView.O
|
||||
setContentView(R.layout.activity_color);
|
||||
ButterKnife.bind(this);
|
||||
|
||||
// workaround for issue #190226 in design libary
|
||||
headerLayout = navigationView.inflateHeaderView(R.layout.navigation_header);
|
||||
headerLayout = navigationView.getHeaderView(0);
|
||||
mStripeName = ButterKnife.findById(headerLayout, R.id.nvh_name);
|
||||
System.out.println("name: " + mStripeName.getText().toString());
|
||||
mStripeType = ButterKnife.findById(headerLayout, R.id.nvh_type);
|
||||
|
||||
@@ -83,11 +83,14 @@ public class ColorService extends Service {
|
||||
@Override
|
||||
public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {
|
||||
JSONRPC2Response reqIn = null;
|
||||
String dataStr = new String(bb.getAllByteArray());
|
||||
|
||||
try {
|
||||
reqIn = JSONRPC2Response.parse(new String(bb.getAllByteArray()));
|
||||
} catch (JSONRPC2ParseException e) {
|
||||
e.printStackTrace();
|
||||
if (!dataStr.isEmpty()) {
|
||||
try {
|
||||
reqIn = JSONRPC2Response.parse(dataStr);
|
||||
} catch (JSONRPC2ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (reqIn != null) {
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/navigation_header"
|
||||
app:menu="@menu/navigation_drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
Reference in New Issue
Block a user