Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Tablexia-old
Tablexia-old
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • labs
  • Tablexia-oldTablexia-old
  • Issues
  • #92

Closed
Open
Opened Apr 15, 2014 by Ghost User@ghostContributor

Odstranění LINT warningu parametry v konstruktoru GameMenuFragment a AbstractMenuFragment

GameMenuFragment a AbstractMenuFragment by neměli používat parametry v konstruktoru

./gradlew unitTest

/home/matyas/workspaceKepler/tablexia/src/main/java/cz/nic/tablexia/menu/mainmenu/screen/gamemenu/GameMenuFragment.java:12: Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment] super(layoutId, inflateinUIThread, introSoundPath); ^ /home/matyas/workspaceKepler/tablexia/src/main/java/cz/nic/tablexia/menu/mainmenu/screen/gamemenu/GameMenuFragment.java:15: Error: This fragment should provide a default constructor (a public constructor with no arguments) (cz.nic.tablexia.menu.mainmenu.screen.gamemenu.GameMenuFragment) [ValidFragment] public GameMenuFragment(int layoutId, String introSoundPath) { ~~~~~~~~~~~~~~~~ /home/matyas/workspaceKepler/tablexia/src/main/java/cz/nic/tablexia/menu/mainmenu/screen/gamemenu/GameMenuFragment.java:16: Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment] super(layoutId, introSoundPath); ^

Explanation for issues of type "ValidFragment": From the Fragment documentation: Every fragment must have an empty constructor, so it can be instantiated when restoring its activity's state. It is strongly recommended that subclasses do not have other constructors with parameters, since these constructors will not be called when the fragment is re-instantiated; instead, arguments can be supplied by the caller with setArguments(Bundle) and later retrieved by the Fragment with getArguments().

http://developer.android.com/reference/android/app/Fragment.html#Fragment()

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: labs/tablexia-old#92