I have created an ArrayList
with count
private ArrayList<GeoJsonResponse> localGeoJsonResponse;
FeatureCollection featureCollection;
GeoJsonResponse data = null;
Integer number = localGeoJsonResponse.size();
String str = Integer.toString(number);
String event= str + " total event";
I have to set a value of the count on sub title of action bar and this is my code
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
ActionBar ab = getActionBar();
ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeButtonEnabled(true);
ab.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.theme_color)));
ab.setTitle(R.string.mappa);
ab.setSubtitle(event);
I receive an error when i call this view. In the setSubtitle I can set only String
, example
ab.setSubtitle("events");
rest of the view works well. Any help please? Thanks
this is the log of error
Caused by: java.lang.NullPointerException
at com.###.###.###.MyMapActivity.onCreate(MyMapActivity.java:164)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at
thanks