尽量让你的谷歌地图的快照:
private void snapShot() {
SnapshotReadyCallback callback = new SnapshotReadyCallback() {
Bitmap bitmap;
@Override
public void onSnapshotReady(Bitmap snapshot) {
// TODO Auto-generated method stub
bitmap = snapshot;
try {
FileOutputStream out = new FileOutputStream(getActivity()
.getFilesDir() + "/MapSnapshot.png");
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (Exception e) {
e.printStackTrace();
}
}
};
map.snapshot(callback);
}
的使它们只有在地图的图片中的新片段。使用replace加载这个新片段,然后在要替换的片段上进行转换: final SnapShotFragment snapFrag = new SnapShotFragment(); FragmentTransaction transaction = getFragmentManager() .beginTransaction();
transaction.replace(MapFragment.this.getId(),
snapFrag);
transaction.addToBackStack(null);
transaction.commit();
getFragmentManager().executePendingTransactions();
final boolean roi = isInROI;
WayPointDetailActivity waypointFrag = new WayPointDetailActivity();
waypointFrag.setWayPointId(wp.getId());
waypointFrag.setInRoi(roi);
transaction = getFragmentManager()
.beginTransaction();
transaction.setCustomAnimations(R.anim.enter,
R.anim.exit);
transaction.replace(snapFrag.getId(), waypointFrag);
transaction.addToBackStack(null);
transaction.commit();
我相信我有它在Galaxy S2上工作,但不是其他人。明天早上我上班时,我会回来向您介绍这方面的情况。 – RobGThai
检查这个问题了。接受的答案帮助了我。 http://stackoverflow.com/questions/7718111/android-fragment-standard-transition-not-animating – Sababado