阅读" Head First Android Programming",它有点过时了,所以本书中显示的代码也已经过时了。 My Code
Android Studio说:错误的第二个参数类型。 找到:com.xfunny.workout.WorkoutDetailFragment',required:android.app.Fragment'
CREATE VIEW QueryV5 AS
SELECT DISTINCT
C.Name, P.Name AS PlanetName, SUM(T.[Time of Departure] - T.[Time of Arrival]) AS TotalTime
FROM cmpt354_starwars.dbo.TimeTable T
JOIN cmpt354_starwars.dbo.Characters C ON C.Name = T.CharacterName
JOIN cmpt354_starwars.dbo.Planets P ON P.Name = T.PlanetName
WHERE P.Affiliation = 'neutral'
GROUP BY C.Name, P.Name
}
答案 0 :(得分:0)
做这样的事情
android.app.Fragment details = new WorkoutDetailFragment();
而不是
WorkoutDetailFragment details = new WorkoutDetailFragment();
答案 1 :(得分:0)
由于您使用的是AppCompatActivity
,因此您需要使用支持库中的Fragment
,即import android.support.v4.app.Fragment
当然,如果您切换到支持片段,则需要使用getSupportFragmentManager()
代替getFragmentManager()