无法在ViewPager中打开视图

时间:2017-02-11 13:28:40

标签: java android android-fragments

我有一个标签式导航应用,但是,视图寻呼机上的视图中有按钮。当按下那些按钮时,我希望它在导航本身内打开另一个视图而不是整个屏幕。

这就是我正在尝试的:

public void postForm(View view) {
    ViewGroup item = (ViewGroup)findViewById(R.id.vp_horizontal_ntb);
    View child = getLayoutInflater().inflate(R.layout.activity_post_form, null);
    item.addView(child);
}

viewpager名称为vp_horizontal_ntb,每当我点击视图中的按钮时,我都会得到以下内容:

02-11 11:26:57.286 2295-2295/? D/HeadsetPhoneState: sendDeviceStateChanged. mService=1 mSignal=5 mRoam=0 mBatteryCharge=4
02-11 11:26:57.395 197-809/? D/audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
02-11 11:26:57.395 197-809/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
02-11 11:26:57.875 776-884/? D/ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 109]
02-11 11:27:00.916 776-884/? D/ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 109]
02-11 11:27:01.085 197-809/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
02-11 11:27:01.095 197-809/? D/audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
02-11 11:27:01.095 197-809/? D/msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(15)
02-11 11:27:01.095 197-809/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
02-11 11:27:01.100 197-809/? D/audio_hw_primary: enable_audio_route: apply and update mixer path: low-latency-playback

这对我来说毫无意义。只是不起作用,我不知道为什么。

(此问题是This one

的扩展

谢谢!

0 个答案:

没有答案