Wrong path when adding custom tab in BuddyPress

When adding a custom tab to the BuddyPress menu i cant load the right template. I think somethings is wrong with the path since I end on the member page who lists all members.

I get this url in my browser: mydomain.com/members/johndoe/myads but it just list all members and not the content from myads.php

I have added myads.php in:
wp-content/plugins/buddypress/bp-themes/bp-default/members/single/myads.php
and
wp-content/themes/my-theme/myads.php

// Set up Cutsom BP navigation
function my_setup_nav() {
  global $bp;

  bp_core_new_nav_item( array( 
        'name' => __( 'My ads', 'buddypress' ), 
        'slug' => 'myads', 
        'position' => 30,
        'screen_function' => 'my_item_one_template', 
  ) );

  // Change the order of menu items
  $bp->bp_nav['messages']['position'] = 100;
}

add_action( 'bp_setup_nav', 'my_setup_nav' );

// Load a page template for your custom item. You'll need to have an myads.php in your theme root.

function my_item_one_template() {
  bp_core_load_template( 'myads');
}

Solutions Collecting From Web of "Wrong path when adding custom tab in BuddyPress"

Try this:

function my_setup_nav() {
  global $bp;

  bp_core_new_nav_item( array( 
      'name' => __( 'My ads', 'buddypress' ),
      'parent_slug' => $bp->profile->slug,
      'slug' => 'myads', 
      'position' => 30,
      'screen_function' => 'my_item_one_template',
      'default_subnav_slug' => 'myads' 
  ) );

}

add_action( 'bp_setup_nav', 'my_setup_nav' );

function my_item_one_template() {
    add_action( 'bp_template_content', 'my_item_create_screen' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}

function my_item_create_screen() { 
    locate_template( array( 'buddypress/members/single/myads.php' ), true );
}

Put myads.php in your theme or child theme in this folder structure:
[theme]/buddypress/members/single/myads.php

If it still doesn’t find the template, you have to register the template so the BP can find it in the template stack. That can be rather complex. An easier method is to put the code directly in the function:

function my_item_create_screen() { 
?>
   <h2>MY ADS</h2>  
<?php 
}