[Java for Android App Development] croccio:
Hi guys. I've a problem woth fragment and layout. here is the code that give me error

MainActivity (I use onClick to load new fragment)

package com.croccio.bicimi4social.activity;

import org.holoeverywhere.ArrayAdapter;
import org.holoeverywhere.app.Activity;
import org.holoeverywhere.app.Fragment;
import org.holoeverywhere.widget.ListView;

import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.View;

import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.croccio.bicimi4social.Bicimi4Social;
import com.croccio.bicimi4social.R;
import com.croccio.bicimi4social.Utility.InternetConnection;
import com.croccio.bicimi4social.bikeSharing.BikeSharing;
import com.croccio.bicimi4social.fragment.FragmentGestionePostazioni;
import com.parse.Parse;
import com.parse.ParseAnalytics;
import com.sherlock.navigationdrawer.compat.SherlockActionBarDrawerToggle;

public class MainActivity extends Activity {

private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private SherlockActionBarDrawerToggle mDrawerToggle;

private CharSequence mDrawerTitle;
private CharSequence mTitle;
private String[] mTitles;

private InternetConnection ic;

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Bicimi4Social.bikeSharing=new BikeSharing(getSupportApplication());

ic = new InternetConnection(this);
ic.run();

Parse.initialize(this, "RxyJKRsDhoO7uwzfToILxNB7lMeLsSHXfrnpZ7sq", "6o3pJSeVXjF13MK7ZvLekPOdtj6RJMMHpEqM80cH");
ParseAnalytics.trackAppOpened(getIntent());

mTitle = mDrawerTitle = getTitle();
mTitles = getResources().getStringArray(R.array.sliding_menu_option);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.left_drawer);

// set a custom shadow that overlays the main content when the drawer opens
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
// set up the drawer's list view with items and click listener
mDrawerList.setAdapter(new ArrayAdapter<String>(this,
R.layout.drawer_list_item, mTitles));
mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

// enable ActionBar app icon to behave as action to toggle nav drawer
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);

// ActionBarDrawerToggle ties together the the proper interactions
// between the sliding drawer and the action bar app icon
mDrawerToggle = new SherlockActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
) {
public void onDrawerClosed(View view) {
getSupportActionBar().setTitle(mTitle);
//invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}

public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(mDrawerTitle);
//invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);

if (savedInstanceState == null) {
selectItem(0);
}
}

[MENTION=439709]override[/MENTION]
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
ic.setRunning(false);
}

[MENTION=439709]override[/MENTION]
protected void onResume() {
// TODO Auto-generated method stub
Log.e("MAIN ACTIVITY", "ONRESUME");
ic.setRunning(true);
ic.run();
super.onResume();

}

[MENTION=439709]override[/MENTION]
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.main, menu);
return super.onCreateOptionsMenu(menu);
}

/* Called whenever we call invalidateOptionsMenu() */
[MENTION=439709]override[/MENTION]
public boolean onPrepareOptionsMenu(Menu menu) {
// If the nav drawer is open, hide action items related to the content view
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
// menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);
return super.onPrepareOptionsMenu(menu);
}

[MENTION=439709]override[/MENTION]
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
// ActionBarDrawerToggle will take care of this.
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
// Handle action buttons
switch(item.getItemId()) {
// case R.id.action_websearch:
// // create intent to perform web search for this planet
// Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
// intent.putExtra(SearchManager.QUERY, getActionBar().getTitle());
// // catch event that there's no activity to handle intent
// if (intent.resolveActivity(getPackageManager()) != null) {
// startActivity(intent);
// } else {
// Toast.makeText(this, R.string.app_not_available, Toast.LENGTH_LONG).show();
// }
// return true;
default:
return super.onOptionsItemSelected(item);
}
}

/* The click listner for ListView in the navigation drawer */
private class DrawerItemClickListener implements ListView.OnItemClickListener {
[MENTION=439709]override[/MENTION]
public void onItemClick(android.widget.AdapterView<?> parent, View view, int position, long id) {
selectItem(position);
switch (position) {
case 0:
// update the main content by replacing fragments
Fragment fragment = new FragmentGestionePostazioni();

FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
break;

default:
break;
}
}
}

private void selectItem(int position) {
// update selected item and title, then close the drawer
mDrawerList.setItemChecked(position, true);
setTitle(mTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
}

[MENTION=439709]override[/MENTION]
public void setTitle(CharSequence title) {
mTitle = title;
getSupportActionBar().setTitle(mTitle);
}

/**
* When using the ActionBarDrawerToggle, you must call it during
* onPostCreate() and onConfigurationChanged()...
*/

[MENTION=439709]override[/MENTION]
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}

[MENTION=439709]override[/MENTION]
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggls
mDrawerToggle.onConfigurationChanged(newConfig);
}
}

here is fragment code

package com.croccio.bicimi4social.fragment;

import org.holoeverywhere.LayoutInflater;
import org.holoeverywhere.app.Fragment;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;

import com.croccio.bicimi4social.R;
import com.croccio.bicimi4social.bikeSharing.BikeSharing;
import com.tjerkw.slideexpandable.library.ActionSlideExpandableListView;

public class FragmentGestionePostazioni extends Fragment {

ActionSlideExpandableListView list;
BikeSharing bikeSharing;
Handler handler;
int click=0;
[MENTION=439709]override[/MENTION]
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View root = inflater.inflate(
R.layout.gestione_postazioni, container, false);
root.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
root.setBackgroundResource(org.holoeverywhere.R.color.background_light);
return root;
}

[MENTION=439709]override[/MENTION]
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}

}

here is the layout for fragment

<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/slidingpanelayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<fragment
android:id="@+id/fragmentGestionePostazioniElenco"
android:name="com.croccio.bicimi4social.fragment.FragmentGestionePostazioniElenco"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light" />

<fragment
android:id="@+id/fragmentGestionePostazioniMappe"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:cameraTargetLat="45.46545420"
map:cameraTargetLng="9.186515999999999"
map:cameraZoom="10"
map:mapType="normal"
map:uiRotateGestures="true"
map:uiScrollGestures="true"
map:uiTiltGestures="true"
map:uiZoomControls="false"
map:uiZoomGestures="true" />

</android.support.v4.widget.SlidingPaneLayout>

here is the logcat error

06-03 11:41:43.936: E/AndroidRuntime(19159): FATAL EXCEPTION: main
06-03 11:41:43.936: E/AndroidRuntime(19159): android.view.InflateException: Binary XML file line #7: Error inflating class fragment
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:242)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:227)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at com.croccio.bicimi4social.fragment.FragmentGestionePostazioni.onCreateView(FragmentGestionePostazioni.java:24)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app._HoloFragment.onCreateView(_HoloFragment.java:214)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.os.Handler.handleCallback(Handler.java:725)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.os.Handler.dispatchMessage(Handler.java:92)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.os.Looper.loop(Looper.java:137)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.app.ActivityThread.main(ActivityThread.java:5229)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at java.lang.reflect.Method.invokeNative(Native Method)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at java.lang.reflect.Method.invoke(Method.java:525)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at dalvik.system.NativeStart.main(Native Method)
06-03 11:41:43.936: E/AndroidRuntime(19159): Caused by: java.lang.ClassCastException: com.croccio.bicimi4social.fragment.FragmentGestionePostazioniElenco cannot be cast to android.app.Fragment
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.app.Fragment.instantiate(Fragment.java:585)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.app.Fragment.instantiate(Fragment.java:560)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.app.Activity.onCreateView(Activity.java:4717)
06-03 11:41:43.936: E/AndroidRuntime(19159):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
06-03 11:41:43.936: E/AndroidRuntime(19159):	... 22 more