Custom Weighting Not Work Android

i want to implement the weighting of graph with my custom weighting in android studio. i try to make custom weighting based on this structure

and i create new class that extends GraphHopper like this
class MyGraphHopper extends GraphHopper {

public Weighting createWeighting(HintsMap hintsMap, FlagEncoder encoder, Graph graph) {
    String weightingStr = hintsMap.getWeighting().toLowerCase();
    if ("my_custom_weighting".equals(weightingStr)) {
        return new MyCustomWeighting(encoder);
    } else {
        return super.createWeighting(hintsMap, encoder, graph);


but when i try to use my custom weighting in another activity like this
GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon)
Its always weighting null not suppoerted