updated deps

removed workaround for issue with the navigationHeader
added handling of empty responses
This commit is contained in:
Giovanni Harting
2015-11-14 14:37:08 +01:00
parent 9739116db6
commit 9a3b955d32
4 changed files with 13 additions and 10 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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>